chiark / gitweb /
acl-util: avoid freeing uninitialized pointer
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Tue, 24 Feb 2015 19:40:07 +0000 (20:40 +0100)
committerThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Tue, 24 Feb 2015 19:42:40 +0000 (20:42 +0100)
CID#1271344/1271345

src/shared/acl-util.c

index 36dc824128b3b4275da94c9bbcd2683df64f119e..36b3f0c16ae4fe5c9e83d1ca82adcea32021e399 100644 (file)
@@ -301,7 +301,7 @@ static int acl_entry_equal(acl_entry_t a, acl_entry_t b) {
                 /* can have only one of those */
                 return true;
         case ACL_USER: {
-                _cleanup_(acl_free_uid_tpp) uid_t *uid_a, *uid_b;
+                _cleanup_(acl_free_uid_tpp) uid_t *uid_a = NULL, *uid_b = NULL;
 
                 uid_a = acl_get_qualifier(a);
                 if (!uid_a)
@@ -314,7 +314,7 @@ static int acl_entry_equal(acl_entry_t a, acl_entry_t b) {
                 return *uid_a == *uid_b;
         }
         case ACL_GROUP: {
-                _cleanup_(acl_free_gid_tpp) gid_t *gid_a, *gid_b;
+                _cleanup_(acl_free_gid_tpp) gid_t *gid_a = NULL, *gid_b = NULL;
 
                 gid_a = acl_get_qualifier(a);
                 if (!gid_a)