libselinux: fix python audit2why binding error
There is a missing error check in audit2why.c. Check for error and return NULL if we can't initialize instead of just pretending it worked. Signed-off-by: Eric Paris <eparis@redhat.com> Acked-by: Dan Walsh <dwalsh@redhat.com>
This commit is contained in:
parent
63df0f7ef1
commit
2ea80c28a5
1 changed files with 3 additions and 2 deletions
|
@ -287,8 +287,9 @@ static int __policy_init(const char *init_path)
|
|||
static PyObject *init(PyObject *self __attribute__((unused)), PyObject *args) {
|
||||
int result;
|
||||
char *init_path=NULL;
|
||||
if (PyArg_ParseTuple(args,(char *)"|s:policy_init",&init_path))
|
||||
result = __policy_init(init_path);
|
||||
if (!PyArg_ParseTuple(args,(char *)"|s:policy_init",&init_path))
|
||||
return NULL;
|
||||
result = __policy_init(init_path);
|
||||
return Py_BuildValue("i", result);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue