FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Device-mapper Development

 
 
LinkBack Thread Tools
 
Old 07-25-2011, 06:27 PM
Benjamin Marzinski
 
Default multipath: strdup multipath alias, so that it isn't deleted.

When a multipath device is added to multipathd with ev_add_map(),
the alias is not duplicated, and is freed immediately after ev_add_map()
returns, causing a memory error. This patch corrects that.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
---
libmultipath/structs_vec.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libmultipath/structs_vec.c b/libmultipath/structs_vec.c
index 189f25b..364e36e 100644
--- a/libmultipath/structs_vec.c
+++ b/libmultipath/structs_vec.c
@@ -373,7 +373,7 @@ add_map_without_path (struct vectors * vecs, char * alias)
if (!mpp || !alias)
return NULL;

- mpp->alias = alias;
+ mpp->alias = STRDUP(alias);

if (setup_multipath(vecs, mpp)) {
mpp->alias = NULL;
--
1.7.4.4

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
 

Thread Tools




All times are GMT. The time now is 10:04 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org