(strpoolcollect): allow p == NULL, return the empty string (allocated)
This commit is contained in:
@@ -100,7 +100,10 @@ rk_strpoolprintf(struct rk_strpool *p, const char *fmt, ...)
|
||||
char * ROKEN_LIB_FUNCTION
|
||||
rk_strpoolcollect(struct rk_strpool *p)
|
||||
{
|
||||
char *str = p->str;
|
||||
char *str;
|
||||
if (p == NULL)
|
||||
return strdup("");
|
||||
str = = p->str;
|
||||
p->str = NULL;
|
||||
free(p);
|
||||
return str;
|
||||
|
Reference in New Issue
Block a user