libselinux: audit2why: do not leak on multiple init() calls
If init() was already called then avc will be set. If avc is set just return. Signed-off-by: Eric Paris <eparis@redhat.com> Acked-by: Dan Walsh <dwalsh@redhat.com>
This commit is contained in:
parent
45b324e27b
commit
d09bcb75f5
|
@ -299,6 +299,10 @@ static int __policy_init(const char *init_path)
|
|||
static PyObject *init(PyObject *self __attribute__((unused)), PyObject *args) {
|
||||
int result;
|
||||
char *init_path=NULL;
|
||||
if (avc) {
|
||||
PyErr_SetString( PyExc_RuntimeError, "init called multiple times");
|
||||
return NULL;
|
||||
}
|
||||
if (!PyArg_ParseTuple(args,(char *)"|s:policy_init",&init_path))
|
||||
return NULL;
|
||||
result = __policy_init(init_path);
|
||||
|
|
Loading…
Reference in New Issue