diff mbox

multipathd: segfault in multipathd cli_add_map()

Message ID E3535A62B291B54FBD1D003696CCB5375E190B04@H3CMLB14-EX.srv.huawei-3com.com (mailing list archive)
State Not Applicable, archived
Delegated to: christophe varoqui
Headers show

Commit Message

Zhangguanghui April 7, 2016, 2:10 a.m. UTC
-------------------------------------------------------------------------------------------------------------------------------------
????????????????????????????????????????
????????????????????????????????????????
????????????????????????????????????????
???
This e-mail and its attachments contain confidential information from H3C, which is
intended only for the person or entity whose address is listed above. Any use of the
information contained herein in any way (including, but not limited to, total or partial
disclosure, reproduction, or dissemination) by persons other than the intended
recipient(s) is prohibited. If you receive this e-mail in error, please notify the sender
by phone or email immediately and delete it!
--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel
diff mbox

Patch

--- multipath-tools-ecf84a8/multipathd/cli_handlers.c 2016-04-07 09:28:46.693622941 +0800
+++ patch/cli_handlers.c 2016-04-07 09:43:36.237622835 +0800
@@ -523,7 +523,8 @@ 
char * param = get_keyparam(v, MAP);
int major, minor;
char dev_path[PATH_SIZE];
- char *alias, *refwwid;
+ char *alias = NULL;
+ char *refwwid = NULL;
int rc, count = 0;

param = convert_dev(param, 0);
@@ -565,8 +566,10 @@ 
return 1;
}
rc = ev_add_map(dev_path, alias, vecs);
- FREE(alias);
- FREE(refwwid);
+ if (alias)
+ FREE(alias);
+ if (refwwid)
+ FREE(refwwid);
return rc;
}

@@ -577,7 +580,7 @@ 
char * param = get_keyparam(v, MAP);
int major, minor;
char dev_path[PATH_SIZE];
- char *alias;
+ char *alias = NULL;
int rc;

param = convert_dev(param, 0);
@@ -600,7 +603,8 @@ 
return 0;
}
rc = ev_remove_map(param, alias, minor, vecs);
- FREE(alias);
+ if (alias)
+ FREE(alias);
return rc;
}