api: fix memory leak in function string_dyn_free()

Bug was introduced by commit af138840b3.
v2.8-utf8proc
Sébastien Helleu 2017-04-02 08:39:29 +02:00
parent 20bb762e28
commit c652598ad7
1 changed files with 5 additions and 3 deletions

View File

@ -3453,10 +3453,12 @@ string_dyn_free (char **string, int free_string)
if (free_string)
{
free (ptr_string_dyn->string);
return NULL;
ptr_string = NULL;
}
else
{
ptr_string = ptr_string_dyn->string;
}
ptr_string = ptr_string_dyn->string;
free (ptr_string_dyn);