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 03-18-2009, 10:38 PM
Konrad Rzeszutek
 
Default Free prio_name and checker_name now that we dynamically allocate them.

From: Konrad Rzeszutek <konrad@mars.virtualiron.com>

In earlier releases the prio_name and checker_name would point
to statically allocated values. Now that we strdup them, we need
to free them during shutdown.
---
libmultipath/config.c | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/libmultipath/config.c b/libmultipath/config.c
index 6d731d2..7307fc0 100644
--- a/libmultipath/config.c
+++ b/libmultipath/config.c
@@ -152,6 +152,11 @@ free_hwe (struct hwentry * hwe)
if (hwe->bl_product)
FREE(hwe->bl_product);

+ if (hwe->prio_name)
+ FREE(hwe->prio_name);
+
+ if (hwe->checker_name)
+ FREE(hwe->checker_name);
FREE(hwe);
}

@@ -250,7 +255,7 @@ set_param_str(char * str)
#define merge_str(s)
if (hwe2->s) {
if (hwe1->s)
- free(hwe1->s);
+ FREE(hwe1->s);
if (!(hwe1->s = set_param_str(hwe2->s)))
return 1;
}
@@ -393,6 +398,12 @@ free_config (struct config * conf)
if (conf->hwhandler)
FREE(conf->hwhandler);

+ if (conf->prio_name)
+ FREE(conf->prio_name);
+
+ if (conf->checker_name)
+ FREE(conf->checker_name);
+
free_blacklist(conf->blist_devnode);
free_blacklist(conf->blist_wwid);
free_blacklist_device(conf->blist_device);
--
1.5.4.1

--
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 03:15 AM.

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