1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-10 16:58:47 +03:00

lvmetad: fix memleak on error path

Release allocated buffer on error path.
This commit is contained in:
Zdenek Kabelac 2012-08-23 11:00:02 +02:00
parent 8edc0e450d
commit 3685701529

View File

@ -400,8 +400,10 @@ static void *client_thread(void *baton)
if (!res.buffer) {
dm_config_write_node(res.cft->root, buffer_line, &res);
if (!buffer_rewrite(&res.buffer, "%s\n\n", NULL))
if (!buffer_rewrite(&res.buffer, "%s\n\n", NULL)) {
dm_free(req.buffer);
goto fail;
}
dm_config_destroy(res.cft);
}