getparam: fix the GetStr() macro
It should return PARAM_NO_MEM if the strdup fails. Spotted by clang-analyzer
This commit is contained in:
parent
0e24c1e921
commit
ff318a6302
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user