Browse Source

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 years ago
parent
commit
85346f4f6d
1 changed files with 2 additions and 1 deletions
  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;