aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2012-07-13 23:39:25 +0200
committerDaniel Stenberg <daniel@haxx.se>2012-07-15 20:33:11 +0200
commitff318a6302a92ffb627ebffb397e8dc2420a96c0 (patch)
tree7c4964826b1901c4bb2368dc4ece528ff78645c7 /src
parent0e24c1e9212d3d06000511c0c6e6dc27da48dc8d (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.c7
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 {