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

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