mirror of
https://github.com/curl/curl.git
synced 2026-04-28 00:22:13 +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
1 changed files with 4 additions and 3 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue