diff options
author | Alasdair Kergon <agk@redhat.com> | 2006-05-10 17:49:25 +0000 |
---|---|---|
committer | Alasdair Kergon <agk@redhat.com> | 2006-05-10 17:49:25 +0000 |
commit | 2c7fbadeef40b3fc6b8a0f92f3e1b29ff314d34e (patch) | |
tree | dd412f84fcaa442c1e5b1f5b327f76465f61d645 /tools/vgcfgbackup.c | |
parent | eba586f053161ff799e273d048f8c203e0ff9181 (diff) | |
download | lvm2-2c7fbadeef40b3fc6b8a0f92f3e1b29ff314d34e.tar.gz |
more coverity fixes
Diffstat (limited to 'tools/vgcfgbackup.c')
-rw-r--r-- | tools/vgcfgbackup.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/vgcfgbackup.c b/tools/vgcfgbackup.c index ae15dbe71..b1af733ca 100644 --- a/tools/vgcfgbackup.c +++ b/tools/vgcfgbackup.c @@ -23,7 +23,11 @@ static char *_expand_filename(const char *template, const char *vg_name, if (security_level()) return dm_strdup(template); - filename = dm_malloc(PATH_MAX); + if (!(filename = dm_malloc(PATH_MAX))) { + log_error("Failed to allocate filename."); + return NULL; + } + if (snprintf(filename, PATH_MAX, template, vg_name) < 0) { log_error("Error processing filename template %s", template); |