utils: fix leak in kv_double_from_string()

We need to free 'pairs' here, do so by jumping to the error label.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2018-05-11 15:02:26 +10:00
parent db2d16bfce
commit 75e4ab05e4

View file

@ -591,7 +591,7 @@ kv_double_from_string(const char *string,
npairs++;
if (npairs == 0)
return -1;
goto error;
result = zalloc(npairs * sizeof *result);