public inbox for lvm2-cvs@sourceware.org help / color / mirror / Atom feed
From: zkabelac@sourceware.org To: lvm-devel@redhat.com, lvm2-cvs@sourceware.org Subject: LVM2/lib raid/raid.c replicator/replicator.c t ... Date: Wed, 25 Jan 2012 21:54:00 -0000 [thread overview] Message-ID: <20120125215401.559.qmail@sourceware.org> (raw) CVSROOT: /cvs/lvm2 Module name: LVM2 Changes by: zkabelac@sourceware.org 2012-01-25 21:54:00 Modified files: lib/raid : raid.c lib/replicator : replicator.c lib/thin : thin.c Log message: Free allocated segment type in error path Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/raid/raid.c.diff?cvsroot=lvm2&r1=1.13&r2=1.14 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/replicator/replicator.c.diff?cvsroot=lvm2&r1=1.11&r2=1.12 http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/lib/thin/thin.c.diff?cvsroot=lvm2&r1=1.44&r2=1.45 --- LVM2/lib/raid/raid.c 2011/11/30 02:02:11 1.13 +++ LVM2/lib/raid/raid.c 2012/01/25 21:54:00 1.14 @@ -452,8 +452,10 @@ do { if ((segtype = raid_segtype_fn[i](cmd)) && - !lvm_register_segtype(seglib, segtype)) - return 0; + !lvm_register_segtype(seglib, segtype)) { + dm_free(segtype); + return_0; + } } while (raid_segtype_fn[++i]); return 1; --- LVM2/lib/replicator/replicator.c 2011/11/29 12:10:38 1.11 +++ LVM2/lib/replicator/replicator.c 2012/01/25 21:54:00 1.12 @@ -772,8 +772,10 @@ segtype->private = NULL; segtype->flags = SEG_REPLICATOR; - if (!lvm_register_segtype(seglib, segtype)) + if (!lvm_register_segtype(seglib, segtype)) { + dm_free(segtype); return_0; + } log_very_verbose("Initialised segtype: " REPLICATOR_MODULE); @@ -785,8 +787,10 @@ segtype->private = NULL; segtype->flags = SEG_REPLICATOR_DEV; - if (!lvm_register_segtype(seglib, segtype)) + if (!lvm_register_segtype(seglib, segtype)) { + dm_free(segtype); return_0; + } log_very_verbose("Initialised segtype: " REPLICATOR_DEV_MODULE); --- LVM2/lib/thin/thin.c 2012/01/25 09:06:43 1.44 +++ LVM2/lib/thin/thin.c 2012/01/25 21:54:00 1.45 @@ -606,8 +606,10 @@ segtype->flags |= SEG_MONITORED; # endif /* DMEVENTD */ #endif - if (!lvm_register_segtype(seglib, segtype)) + if (!lvm_register_segtype(seglib, segtype)) { + dm_free(segtype); return_0; + } log_very_verbose("Initialised segtype: %s", segtype->name); }
reply other threads:[~2012-01-25 21:54 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=20120125215401.559.qmail@sourceware.org \ --to=zkabelac@sourceware.org \ --cc=lvm-devel@redhat.com \ --cc=lvm2-cvs@sourceware.org \ /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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).