mirror of
https://github.com/SELinuxProject/setools
synced 2025-03-19 17:53:56 +00:00
SELinuxPolicy: Ensure all C members are initialized and deallocated.
This commit is contained in:
parent
6d7a672611
commit
2db83f9b0b
@ -53,7 +53,7 @@ cdef class SELinuxPolicy:
|
|||||||
Parameter:
|
Parameter:
|
||||||
policyfile Path to a policy to open.
|
policyfile Path to a policy to open.
|
||||||
"""
|
"""
|
||||||
|
self.sh = NULL
|
||||||
self.handle = NULL
|
self.handle = NULL
|
||||||
self.cat_val_to_struct = NULL
|
self.cat_val_to_struct = NULL
|
||||||
self.level_val_to_struct = NULL
|
self.level_val_to_struct = NULL
|
||||||
@ -72,10 +72,10 @@ cdef class SELinuxPolicy:
|
|||||||
PyMem_Free(self.cat_val_to_struct)
|
PyMem_Free(self.cat_val_to_struct)
|
||||||
PyMem_Free(self.level_val_to_struct)
|
PyMem_Free(self.level_val_to_struct)
|
||||||
|
|
||||||
if self.handle:
|
if self.handle != NULL:
|
||||||
sepol.sepol_policydb_free(self.handle)
|
sepol.sepol_policydb_free(self.handle)
|
||||||
|
|
||||||
if self.sh:
|
if self.sh != NULL:
|
||||||
sepol.sepol_handle_destroy(self.sh)
|
sepol.sepol_handle_destroy(self.sh)
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user