From: paco Date: Wed, 13 Jun 2018 16:38:46 +0000 (+0200) Subject: lib: null check (Coverity 1436343) X-Git-Tag: frr-6.1-dev~326^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=4ac99370b0f4556dc8a790af6dea2bf643536b88;p=mirror%2Ffrr.git lib: null check (Coverity 1436343) Signed-off-by: F. Aragon --- diff --git a/lib/memory.c b/lib/memory.c index 318c381bf5..e279b17d12 100644 --- a/lib/memory.c +++ b/lib/memory.c @@ -81,7 +81,7 @@ void *qrealloc(struct memtype *mt, void *ptr, size_t size) void *qstrdup(struct memtype *mt, const char *str) { - return mt_checkalloc(mt, strdup(str), strlen(str) + 1); + return str ? mt_checkalloc(mt, strdup(str), strlen(str) + 1) : NULL; } void qfree(struct memtype *mt, void *ptr)