diff --git a/libdm/libdm-string.c b/libdm/libdm-string.c index 42efcf717..4468555cd 100644 --- a/libdm/libdm-string.c +++ b/libdm/libdm-string.c @@ -161,6 +161,7 @@ int dm_asprintf(char **result, const char *format, ...) dm_free(buf); return -1; } + dm_free(buf); } else *result = buf;