From d038f4c1484ef73ac7164d965e5289af9fc20630 Mon Sep 17 00:00:00 2001 From: Steven Dake Date: Thu, 19 Mar 2009 23:50:35 +0000 Subject: [PATCH] While looking at used of LCRSODIR, I saw an unchecked strdup. That could lead to a NULL dereference. git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1878 fd59a12c-fef9-0310-b244-a6a79926bd2f --- lcr/lcr_ifact.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lcr/lcr_ifact.c b/lcr/lcr_ifact.c index b5ed62f1..b1ea5dc7 100644 --- a/lcr/lcr_ifact.c +++ b/lcr/lcr_ifact.c @@ -176,8 +176,7 @@ static void defaults_path_build (void) char *res; res = getcwd (cwd, sizeof (cwd)); - if (res != NULL) { - path_list[0] = strdup (cwd); + if (res != NULL && (path_list[0] = strdup (cwd)) != NULL) { path_list_entries++; }