Version 2.02.78 -
====================================
+ Add missing test for failed pool allocation in write_config_node().
Replace snprintf with dm_snprintf in clvmd-command.c.
Check reallocated buffer for NULL before use in clvmd do_command().
Fix memory leak when VG allocation policy in metadata is invalid.
{
struct output_line outline;
outline.fp = NULL;
- outline.mem = dm_pool_create("config_line", 1024);
+ if (!(outline.mem = dm_pool_create("config_line", 1024)))
+ return_0;
outline.putline = putline;
outline.putline_baton = baton;
if (!_write_config(cn, 0, &outline, 0)) {
return 0;
}
- outline.mem = dm_pool_create("config_line", 1024);
+ if (!(outline.mem = dm_pool_create("config_line", 1024))) {
+ r = 0;
+ goto_out;
+ }
log_verbose("Dumping configuration to %s", file);
if (!argc) {
argv++;
}
+ dm_pool_destroy(outline.mem);
+
+out:
if (outline.fp && lvm_fclose(outline.fp, file)) {
stack;
r = 0;
}
- dm_pool_destroy(outline.mem);
return r;
}