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