瀏覽代碼

Bug 630091 - (cov#15516,15517) Initialize pointers before attempting to free

If we encounter an error early in
ldbm_instance_index_config_modify_callback(), we jump to the out
label where we try to free origMatchingRules, but it may not be
initialized. The same is true for origIndexTypes. We need to
initialize these pointers to NULL.
Nathan Kinder 15 年之前
父節點
當前提交
85346f4f6d
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      ldap/servers/slapd/back-ldbm/ldbm_index_config.c

+ 2 - 1
ldap/servers/slapd/back-ldbm/ldbm_index_config.c

@@ -398,7 +398,8 @@ ldbm_instance_index_config_modify_callback(Slapi_PBlock *pb, Slapi_Entry *e,
     LDAPMod **mods;
     char *arglist[4] = {0};
     char *config_attr;
-    char *origIndexTypes, *origMatchingRules;
+    char *origIndexTypes = NULL;
+    char *origMatchingRules = NULL;
     char **origIndexTypesArray = NULL;
     char **origMatchingRulesArray = NULL;
     char **addIndexTypesArray = NULL;