mirror of
https://github.com/curl/curl.git
synced 2025-09-27 14:36:48 +03:00
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)); \
|
free(*(str)); \
|
||||||
*(str) = NULL; \
|
*(str) = NULL; \
|
||||||
} \
|
} \
|
||||||
if((val)) \
|
if((val)) { \
|
||||||
*(str) = strdup((val)); \
|
*(str) = strdup((val)); \
|
||||||
if(!(val)) \
|
if(!(*(str))) \
|
||||||
return PARAM_NO_MEM; \
|
return PARAM_NO_MEM; \
|
||||||
|
} \
|
||||||
} WHILE_FALSE
|
} WHILE_FALSE
|
||||||
|
|
||||||
struct LongShort {
|
struct LongShort {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user