Received: from eggs.gnu.org ([140.186.70.92]:48219) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RKlLh-0003Dy-KJ for qemu-devel@nongnu.org; Mon, 31 Oct 2011 02:27:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RKlLg-0001gH-5X for qemu-devel@nongnu.org; Mon, 31 Oct 2011 02:27:57 -0400 From: Markus Armbruster References: <1319838533-25405-1-git-send-email-pavel.borzenkov@gmail.com> Date: Mon, 31 Oct 2011 07:27:52 +0100 In-Reply-To: <1319838533-25405-1-git-send-email-pavel.borzenkov@gmail.com> (Pavel Borzenkov's message of "Sat, 29 Oct 2011 01:48:53 +0400") Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [PATCH] cmd: Fix potential NULL pointer dereference List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Pavel Borzenkov Cc: qemu-trivial@nongnu.org, qemu-devel@nongnu.org Pavel Borzenkov writes: > Signed-off-by: Pavel Borzenkov > --- > Note, that almost all code in the file violates CODING STYLE. The changed lines > are written wrt CODING STYLE (like commits 7d7d975c and c32d766a). > > --- > > cmd.c | 11 +++-------- > 1 files changed, 3 insertions(+), 8 deletions(-) > > diff --git a/cmd.c b/cmd.c > index f77897e..abcf206 100644 > --- a/cmd.c > +++ b/cmd.c > @@ -49,7 +49,7 @@ void > add_command( > const cmdinfo_t *ci) > { > - cmdtab = realloc((void *)cmdtab, ++ncmds * sizeof(*cmdtab)); > + cmdtab = g_realloc((void *)cmdtab, ++ncmds * sizeof(*cmdtab)); > cmdtab[ncmds - 1] = *ci; > qsort(cmdtab, ncmds, sizeof(*cmdtab), compare); > } Inconsistent indentation. Either stick to the original indentation, or reindent the whole function. [More of the same...]