Skip to contentSkip to conversation

Fix memory leak in clear_obsolete

SEMANAGE Ivan Gyurdiev 1 participant 1 message Dec 13, 2005 SELinux security module

lore
Share & tools
lore
#0 lore raw
libsemanage/src/policy_components.c +2 -1
diff -Naurp --exclude-from excludes old/libsemanage/src/policy_components.c new/libsemanage/src/policy_components.c
@@ -44,12 +44,13 @@ static int clear_obsolete(
 			/* FIXME: notice to user */	
                         /* INFO(handle, "boolean %s is obsolete, unsetting configured value..."); */
 		}
+
+		rtable->key_free(key);
 	}
 
 	for (i=0; i < nrecords; i++)	
 		rtable->free(records[i]);
 	free(records);
-	rtable->key_free(key);
 	return STATUS_SUCCESS;
 
 	err: