소스 검색

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;