X-Git-Url: http://gitweb.michael.orlitzky.com/?a=blobdiff_plain;f=src%2Flibadacl.c;h=b8f609989f8e962e37bb2ce95c3154131f777947;hb=a940e75467931de75e969b3de97f21698ec6fa08;hp=49628e75bdf2a1ff73104e059729efc962562096;hpb=e400447222fb9db8d5b2b2e3de2892dbe22fa145;p=apply-default-acl.git diff --git a/src/libadacl.c b/src/libadacl.c index 49628e7..b8f6099 100644 --- a/src/libadacl.c +++ b/src/libadacl.c @@ -803,7 +803,7 @@ int apply_default_acl_ex(const char* path, } /* There's a good reason why we saved the ACL above, even though - * we're about tto read it back into memory and mess with it on the + * we're about to read it back into memory and mess with it on the * next line. The acl_copy_xattr() function is already a hack to let * us copy default ACLs without resorting to path names; we simply * have no way to read the parent's default ACL into memory using @@ -814,7 +814,7 @@ int apply_default_acl_ex(const char* path, */ /* Now we potentially need to mask the execute permissions in the - ACL on fd; or maybe now. */ + ACL on fd; or maybe not. */ if (allow_exec) { goto cleanup; } @@ -906,12 +906,9 @@ int apply_default_acl_ex(const char* path, cleanup: free(dirname_path_copy); free(basename_path_copy); - if (new_acl != (acl_t)NULL) { - acl_free(new_acl); - } - if (new_acl_unmasked != (acl_t)NULL) { - acl_free(new_acl_unmasked); - } + acl_free(new_acl); + acl_free(new_acl_unmasked); + if (fd > 0 && close(fd) == CLOSE_ERROR) { perror("apply_default_acl_ex (close fd)"); result = ACL_ERROR;