Blame SOURCES/dhcp-CVE-2022-2928.patch

ce50bf
diff --git a/common/options.c b/common/options.c
ce50bf
index ed8ac38..addc65a 100644
ce50bf
--- a/common/options.c
ce50bf
+++ b/common/options.c
ce50bf
@@ -4397,6 +4397,8 @@ add_option(struct option_state *options,
ce50bf
 	if (!option_cache_allocate(&oc, MDL)) {
ce50bf
 		log_error("No memory for option cache adding %s (option %d).",
ce50bf
 			  option->name, option_num);
ce50bf
+		/* Get rid of reference created during hash lookup. */
ce50bf
+		option_dereference(&option, MDL);
ce50bf
 		return 0;
ce50bf
 	}
ce50bf
 
ce50bf
@@ -4408,6 +4410,8 @@ add_option(struct option_state *options,
ce50bf
 			     MDL)) {
ce50bf
 		log_error("No memory for constant data adding %s (option %d).",
ce50bf
 			  option->name, option_num);
ce50bf
+		/* Get rid of reference created during hash lookup. */
ce50bf
+		option_dereference(&option, MDL);
ce50bf
 		option_cache_dereference(&oc, MDL);
ce50bf
 		return 0;
ce50bf
 	}
ce50bf
@@ -4416,6 +4420,9 @@ add_option(struct option_state *options,
ce50bf
 	save_option(&dhcp_universe, options, oc);
ce50bf
 	option_cache_dereference(&oc, MDL);
ce50bf
 
ce50bf
+	/* Get rid of reference created during hash lookup. */
ce50bf
+	option_dereference(&option, MDL);
ce50bf
+
ce50bf
 	return 1;
ce50bf
 }
ce50bf