diff options
Diffstat (limited to 'libmount/python/context.c')
-rw-r--r-- | libmount/python/context.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libmount/python/context.c b/libmount/python/context.c index ce7711b3f..408c8bd75 100644 --- a/libmount/python/context.c +++ b/libmount/python/context.c @@ -854,8 +854,7 @@ static PyObject *Context_get_fstab(ContextObjext *self) { struct libmnt_table *tab = NULL; - mnt_context_get_fstab(self->cxt, &tab); - if (!tab) + if (mnt_context_get_fstab(self->cxt, &tab) != 0 || !tab) return NULL; return PyObjectResultTab(tab); } @@ -864,7 +863,8 @@ static PyObject *Context_get_mtab(ContextObjext *self) { struct libmnt_table *tab = NULL; - mnt_context_get_mtab(self->cxt, &tab); + if (mnt_context_get_mtab(self->cxt, &tab) != 0 || !tab) + return NULL; return PyObjectResultTab(tab); } |