[augeas-devel] [PATCH] compile_exp: don't return an uninitialized pointer upon failure
Dominic Cleal
dcleal at redhat.com
Fri Apr 6 14:29:24 UTC 2012
On 06/04/12 12:01, Jim Meyering wrote:
> I wrote this patch back in December, but apparently never posted it.
> Here you go:
>
>>From 41c8facd83f6497ded1f42163f3b472124f75f14 Mon Sep 17 00:00:00 2001
> From: Jim Meyering <meyering at redhat.com>
> Date: Fri, 23 Dec 2011 23:19:41 +0100
> Subject: [PATCH] compile_exp: don't return an uninitialized pointer upon
> failure
>
> As a result of its improved flow analysis gcc-4.7.0 20111202 reported:
>
> syntax.c: In function 'compile_exp':
> syntax.c:1694:5: warning: 'v' may be used uninitialized in this \
> function [-Wmaybe-uninitialized]
>
> However, compile_exp calls many functions that return values that are
> then assigned to "v". Only two of those had a problem: in each there
> is an error path by which the returned pointer is not initialized.
> * src/syntax.c (compile_concat): Initialize "v".
> (compile_minus): Likewise.
Thanks for the fix, applied.
--
Dominic Cleal
Red Hat Consulting
m: +44 (0)7817 878113
More information about the augeas-devel
mailing list