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

Fix resource leak of dlopened pointer

Add missing dlclose in _init_formats() error path.
Use return_0 to print stack trace from the call.
This commit is contained in:
Zdenek Kabelac 2010-11-24 09:34:34 +00:00
parent 2044eacc7e
commit e8ec0ba2e3
2 changed files with 6 additions and 2 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.78 -
====================================
Fix missing dlclose in _init_formats() error path from init_format call.
Fix missing fclose for _umount() in dmeventd snapshot plugin.
Fix out-of-scope variable usage in process_each_lv().
Fix dm_task_destroy(NULL) call in _node_clear_table() error path.

View File

@ -814,8 +814,11 @@ static int _init_formats(struct cmd_context *cmd)
return 0;
}
if (!(fmt = init_format_fn(cmd)))
return 0;
if (!(fmt = init_format_fn(cmd))) {
dlclose(lib);
return_0;
}
fmt->library = lib;
dm_list_add(&cmd->formats, &fmt->list);
}