All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zdenek Kabelac <zkabelac@sourceware.org>
To: lvm-devel@redhat.com
Subject: master - coverity: missing free on error path
Date: Wed, 28 Feb 2018 15:22:11 -0500	[thread overview]
Message-ID: <201802282022.w1SKMBYM009728@lists01.pubmisc.prod.ext.phx2.redhat.com> (raw)

Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=9bfc8881cb712a6b164f08ca3d70ec99745e6c22
Commit:        9bfc8881cb712a6b164f08ca3d70ec99745e6c22
Parent:        32bcdd90ae7c847e7b4fc5cc5184c581a4f6484a
Author:        Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate:    Sun Feb 25 16:17:42 2018 +0100
Committer:     Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Wed Feb 28 21:05:18 2018 +0100

coverity: missing free on error path

---
 daemons/dmfilemapd/dmfilemapd.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/daemons/dmfilemapd/dmfilemapd.c b/daemons/dmfilemapd/dmfilemapd.c
index aa50242..7519799 100644
--- a/daemons/dmfilemapd/dmfilemapd.c
+++ b/daemons/dmfilemapd/dmfilemapd.c
@@ -802,7 +802,7 @@ bad:
 	return 1;
 }
 
-static const char * _mode_names[] = {
+static const char * const _mode_names[] = {
 	"inode",
 	"path"
 };
@@ -827,8 +827,10 @@ int main(int argc, char **argv)
 		 "mode=%s, path=%s", fm.fd, fm.group_id,
 		 _mode_names[fm.mode], fm.path);
 
-	if (!_foreground && !_daemonise(&fm))
+	if (!_foreground && !_daemonise(&fm)) {
+		dm_free(fm.path);
 		return 1;
+	}
 
 	return _dmfilemapd(&fm);
 }



                 reply	other threads:[~2018-02-28 20:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201802282022.w1SKMBYM009728@lists01.pubmisc.prod.ext.phx2.redhat.com \
    --to=zkabelac@sourceware.org \
    --cc=lvm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.