From 27ceb7ad334ca78cd59601438ce059787567243a Mon Sep 17 00:00:00 2001 From: Tilka Date: Sat, 21 Apr 2012 09:46:50 +0200 Subject: [PATCH] fix use of uninitialized struct ip_range --- src/core/commands.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/commands.c b/src/core/commands.c index 9ba40ec..70a649f 100644 --- a/src/core/commands.c +++ b/src/core/commands.c @@ -108,6 +108,9 @@ void hub_command_args_free(struct hub_command* cmd) case type_string: hub_free(data->data.string); break; + case type_range: + hub_free(data->data.range); + break; default: break; } @@ -241,8 +244,10 @@ static enum command_parse_status command_extract_arguments(struct command_base* case 'r': data = hub_malloc(sizeof(*data)); data->type = type_range; + data->data.range = hub_malloc_zero(sizeof(struct ip_range)); if (!ip_convert_address_to_range(token, data->data.range)) { + hub_free(data->data.range); hub_free(data); data = NULL; status = cmd_status_arg_address;