From: Patrik Flykt Date: Wed, 22 May 2013 09:21:34 +0000 (+0300) Subject: client: Reserve space for trailing NULL in the array X-Git-Tag: 1.15~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a99487eac8e93c887e23e524b31e03904b318669;p=platform%2Fupstream%2Fconnman.git client: Reserve space for trailing NULL in the array --- diff --git a/client/input.c b/client/input.c index a6eb136..78f68a9 100644 --- a/client/input.c +++ b/client/input.c @@ -96,7 +96,7 @@ static void rl_handler(char *input) args = g_strsplit(input, " ", 0); num = g_strv_length(args); - trim_args = g_new0(char *, num); + trim_args = g_new0(char *, num + 1); for (i = 0, len = 0; i < num; i++) { if (*args[i] != '\0') { trim_args[len] = args[i];