From a732e54aad9cff72097ff3020ef5c15ecd61b388 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Fri, 13 Jul 2012 18:38:52 +0200 Subject: gsyncd: don't dereference NULL upon failed realloc Fix typo: s/buf/*buf/ in test for failed *buf = realloc... Spotted by coverity. Change-Id: Ie1db59956e331c3691f4ed470a3fbaf2bd2e2055 BUG: 789278 Signed-off-by: Jim Meyering Reviewed-on: http://review.gluster.com/3669 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/features/marker/utils/src/gsyncd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'xlators/features/marker') diff --git a/xlators/features/marker/utils/src/gsyncd.c b/xlators/features/marker/utils/src/gsyncd.c index 487eea1e..3f4c2c4b 100644 --- a/xlators/features/marker/utils/src/gsyncd.c +++ b/xlators/features/marker/utils/src/gsyncd.c @@ -48,7 +48,7 @@ duplexpand (void **buf, size_t tsiz, size_t *len) size_t osiz = tsiz * *len; *buf = realloc (*buf, osiz << 1); - if (!buf) + if (!*buf) return -1; memset ((char *)*buf + osiz, 0, osiz); -- cgit