Просмотр исходного кода

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 лет назад
Родитель
Сommit
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;
     LDAPMod **mods;
     char *arglist[4] = {0};
     char *arglist[4] = {0};
     char *config_attr;
     char *config_attr;
-    char *origIndexTypes, *origMatchingRules;
+    char *origIndexTypes = NULL;
+    char *origMatchingRules = NULL;
     char **origIndexTypesArray = NULL;
     char **origIndexTypesArray = NULL;
     char **origMatchingRulesArray = NULL;
     char **origMatchingRulesArray = NULL;
     char **addIndexTypesArray = NULL;
     char **addIndexTypesArray = NULL;