diff options
Diffstat (limited to 'common/options.c')
-rw-r--r-- | common/options.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/common/options.c b/common/options.c index 92c8fee6..f0959cb2 100644 --- a/common/options.c +++ b/common/options.c @@ -4452,6 +4452,8 @@ add_option(struct option_state *options, if (!option_cache_allocate(&oc, MDL)) { log_error("No memory for option cache adding %s (option %d).", option->name, option_num); + /* Get rid of reference created during hash lookup. */ + option_dereference(&option, MDL); return 0; } @@ -4463,6 +4465,8 @@ add_option(struct option_state *options, MDL)) { log_error("No memory for constant data adding %s (option %d).", option->name, option_num); + /* Get rid of reference created during hash lookup. */ + option_dereference(&option, MDL); option_cache_dereference(&oc, MDL); return 0; } @@ -4471,6 +4475,9 @@ add_option(struct option_state *options, save_option(&dhcp_universe, options, oc); option_cache_dereference(&oc, MDL); + /* Get rid of reference created during hash lookup. */ + option_dereference(&option, MDL); + return 1; } |