Blame SOURCES/CVE-2022-2928.patch

0b4c43
diff --git a/common/options.c b/common/options.c
0b4c43
index a53484e..40238f7 100644
0b4c43
--- a/common/options.c
0b4c43
+++ b/common/options.c
0b4c43
@@ -4499,6 +4499,8 @@ add_option(struct option_state *options,
0b4c43
 	if (!option_cache_allocate(&oc, MDL)) {
0b4c43
 		log_error("No memory for option cache adding %s (option %d).",
0b4c43
 			  option->name, option_num);
0b4c43
+		/* Get rid of reference created during hash lookup. */
0b4c43
+		option_dereference(&option, MDL);
0b4c43
 		return 0;
0b4c43
 	}
0b4c43
 
0b4c43
@@ -4510,6 +4512,8 @@ add_option(struct option_state *options,
0b4c43
 			     MDL)) {
0b4c43
 		log_error("No memory for constant data adding %s (option %d).",
0b4c43
 			  option->name, option_num);
0b4c43
+		/* Get rid of reference created during hash lookup. */
0b4c43
+		option_dereference(&option, MDL);
0b4c43
 		option_cache_dereference(&oc, MDL);
0b4c43
 		return 0;
0b4c43
 	}
0b4c43
@@ -4518,6 +4522,9 @@ add_option(struct option_state *options,
0b4c43
 	save_option(&dhcp_universe, options, oc);
0b4c43
 	option_cache_dereference(&oc, MDL);
0b4c43
 
0b4c43
+	/* Get rid of reference created during hash lookup. */
0b4c43
+	option_dereference(&option, MDL);
0b4c43
+
0b4c43
 	return 1;
0b4c43
 }
0b4c43