Patch looks sensible but won't compile on gcc 2.9x because char * is declared inside a code segment.
Could you fix up the patch to declare it during variable declaration? thanks. -steve On Thu, 2009-03-19 at 14:52 +0100, Jim Meyering wrote: > From: > Jim Meyering <[email protected]> > To: > [email protected] > Subject: > [Openais] 2/3: [PATCH] don't store > (and later dereference NULL) upon > strdup failure > Date: > Thu, 19 Mar 2009 14:52:06 +0100 > (06:52 MST) > > > Here's another: > > From d427a9543cc192649a648c5f11ec112e9fe66eb5 Mon Sep 17 00:00:00 2001 > From: Jim Meyering <[email protected]> > Date: Thu, 19 Mar 2009 14:51:20 +0100 > Subject: [PATCH] don't store (and later dereference NULL) upon strdup > failure > > (ld_library_path_build): Don't store NULL when strdup fails. > --- > lcr/lcr_ifact.c | 4 +++- > 1 files changed, 3 insertions(+), 1 deletions(-) > > diff --git a/lcr/lcr_ifact.c b/lcr/lcr_ifact.c > index b1ea5dc..4548b96 100644 > --- a/lcr/lcr_ifact.c > +++ b/lcr/lcr_ifact.c > @@ -200,7 +200,9 @@ static void ld_library_path_build (void) > > p_s = strtok_r (my_ld_library_path, ":", &ptrptr); > while (p_s != NULL) { > - path_list[path_list_entries++] = strdup (p_s); > + char *p = strdup (p_s); > + if (p) > + path_list[path_list_entries++] = p; > p_s = strtok_r (NULL, ":", &ptrptr); > } > _______________________________________________ Openais mailing list [email protected] https://lists.linux-foundation.org/mailman/listinfo/openais
