From: octo Date: Fri, 10 Mar 2006 11:16:21 +0000 (+0000) Subject: Assure that `sstrdup' works with NULL-pointers X-Git-Tag: collectd-3.8.6^2~125 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=ed453a92045e824755c46dcc1cf6e1522f918dd7;p=collectd.git Assure that `sstrdup' works with NULL-pointers --- diff --git a/src/common.c b/src/common.c index 43a51a57..50a563a3 100644 --- a/src/common.c +++ b/src/common.c @@ -56,6 +56,9 @@ char *sstrdup (const char *s) { char *r; + if (s == NULL) + return (NULL); + if((r = strdup (s)) == NULL) { DBG ("Not enough memory.");