Browse Source

609255 - fix coverity Defect Type: Memory - illegal accesses issues

https://bugzilla.redhat.com/show_bug.cgi?id=609255

12291 USE_AFTER_FREE Triaged Unassigned Bug Minor Fix Required
dbconf_read_default_dbinfo_sub() ds/lib/ldaputil/dbconf.c

Comment:
should never happen - should always break out of the loop at 504
with a valid db_info - but we should set db_info = NULL after line
505 just to make sure
Noriko Hosoi 15 years ago
parent
commit
7fa74e30e3
1 changed files with 1 additions and 0 deletions
  1. 1 0
      lib/ldaputil/dbconf.c

+ 1 - 0
lib/ldaputil/dbconf.c

@@ -503,6 +503,7 @@ int dbconf_read_default_dbinfo_sub (const char *file,
     {
 	if (!strcmp(db_info->dbname, DBCONF_DEFAULT_DBNAME)) break;
 	dbconf_free_dbinfo(db_info);
+	db_info = NULL;
     }
 
     if (rv != LDAPU_SUCCESS) {