Merge "Modify the strlen judgement to avoid memory leak."
This commit is contained in:
commit
6e024a648f
|
@ -285,8 +285,8 @@ int msgClassAddr::getAddressFromInterface(const char* interface, char* address,
|
||||||
char *clstr_iface_name = NULL;
|
char *clstr_iface_name = NULL;
|
||||||
|
|
||||||
get_clstr_iface(&clstr_iface_name);
|
get_clstr_iface(&clstr_iface_name);
|
||||||
if (clstr_iface_name && strlen(clstr_iface_name)) {
|
if (clstr_iface_name) {
|
||||||
if (!strcmp(interface, clstr_iface_name)) {
|
if (strlen(clstr_iface_name) && (!strcmp(interface, clstr_iface_name))) {
|
||||||
if (!strcmp(clstr_iface_name, daemon_mgmnt_iface().data())) {
|
if (!strcmp(clstr_iface_name, daemon_mgmnt_iface().data())) {
|
||||||
// cluster-host and mgmt interface name are the same
|
// cluster-host and mgmt interface name are the same
|
||||||
interface_type = MGMNT_IFACE;
|
interface_type = MGMNT_IFACE;
|
||||||
|
|
Loading…
Reference in New Issue