diff options
author | Daniel Stenberg <daniel@haxx.se> | 2012-07-13 23:39:25 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2012-07-15 20:33:11 +0200 |
commit | ff318a6302a92ffb627ebffb397e8dc2420a96c0 (patch) | |
tree | 7c4964826b1901c4bb2368dc4ece528ff78645c7 /src | |
parent | 0e24c1e9212d3d06000511c0c6e6dc27da48dc8d (diff) |
getparam: fix the GetStr() macro
It should return PARAM_NO_MEM if the strdup fails. Spotted by
clang-analyzer
Diffstat (limited to 'src')
-rw-r--r-- | src/tool_getparam.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/tool_getparam.c b/src/tool_getparam.c index 579437eb7..685c224de 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 { |