瀏覽代碼

Bug 619122 - fix coverify Defect Type: Resource leaks issues CID 11975 - 12053

https://bugzilla.redhat.com/show_bug.cgi?id=619122
Resolves: bug 619122
Bug description: fix coverify Defect Type: Resource leaks issues CID 11984.
description: The mtn_get_referral_from_entry() has been modified to avoid leaking the referral object.
Endi S. Dewata 15 年之前
父節點
當前提交
677e84cd44
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      ldap/servers/slapd/mapping_tree.c

+ 1 - 1
ldap/servers/slapd/mapping_tree.c

@@ -475,13 +475,13 @@ mtn_get_referral_from_entry(Slapi_Entry * entry)
         return NULL;
 
     slapi_attr_get_numvalues(attr, &nb);
-    referral = (char **) slapi_ch_malloc(sizeof(char *) * (nb+1));
     hint = slapi_attr_first_value(attr, &val);
     if (NULL == val) {
         LDAPDebug(LDAP_DEBUG_ANY, "Warning: The nsslapd-referral attribute has no value for the mapping tree node %s\n", slapi_entry_get_dn(entry), 0, 0);
     return NULL;
     }
 
+    referral = (char **) slapi_ch_malloc(sizeof(char *) * (nb+1));
     nb = 0;
     while (val)
     {