From 7c479f50bdc0e623757e1b8897e9bae3c47cbfd5 Mon Sep 17 00:00:00 2001 From: Iustin Pop Date: Sat, 30 Nov 2019 16:58:31 +0100 Subject: [PATCH] Minor change on how error handling style in ACL_init --- acl.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/acl.c b/acl.c index 7d7f4b2..a12a9c5 100644 --- a/acl.c +++ b/acl.c @@ -165,6 +165,8 @@ static int ACL_init(PyObject* obj, PyObject* args, PyObject *keywds) { if(self->acl != NULL) acl_free(self->acl); + self->acl = NULL; + if(file != NULL) { fprintf(stderr, "foobar!\n"); char *path = PyBytes_AS_STRING(file); @@ -176,11 +178,8 @@ static int ACL_init(PyObject* obj, PyObject* args, PyObject *keywds) { int fdval; if ((fdval = PyObject_AsFileDescriptor(fd)) != -1) { self->acl = acl_get_fd(fdval); - } else { - self->acl = NULL; } - } - else if(thesrc != NULL) + } else if(thesrc != NULL) self->acl = acl_dup(thesrc->acl); else if(filedef != NULL) { char *path = PyBytes_AS_STRING(filedef); -- 2.39.5