Skip to contentSkip to conversation

policycoreutils: needless check

PATCH New [email protected] 1 participant 1 message Aug 22, 2005 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 policycoreutils: needless check

The following patch removes a needless check found by Coverity.

The only way we jump to bad: is long after p->policy has been calloc'ed (in sepol_module_package_init()), so the check for (p->policy) is not necessary.

thanks,
-serge

semodule_link.c +1 -3
Index: semodule_link/semodule_link.c
===================================================================
@@ -70,9 +70,7 @@ static sepol_module_package_t *load_modu
 
 	return p;
 bad:
-	if (p->policy) {
-		policydb_destroy(p->policy);
-	}
+	policydb_destroy(p->policy);
 	if (p->file_contexts)
 		free(p->file_contexts);
 	return NULL;

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.