From: Daniel Stenberg Date: Fri, 13 Jul 2012 21:39:25 +0000 (+0200) Subject: getparam: fix the GetStr() macro X-Git-Tag: curl-7_27_0~27 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ff318a6302a92ffb627ebffb397e8dc2420a96c0;p=thirdparty%2Fcurl.git getparam: fix the GetStr() macro It should return PARAM_NO_MEM if the strdup fails. Spotted by clang-analyzer --- diff --git a/src/tool_getparam.c b/src/tool_getparam.c index 579437eb77..685c224de3 100644 --- a/src/tool_getparam.c +++ b/src/tool_getparam.c @@ -56,10 +56,11 @@ free(*(str)); \ *(str) = NULL; \ } \ - if((val)) \ + if((val)) { \ *(str) = strdup((val)); \ - if(!(val)) \ - return PARAM_NO_MEM; \ + if(!(*(str))) \ + return PARAM_NO_MEM; \ + } \ } WHILE_FALSE struct LongShort {