Skip to contentSkip to conversation

nfs4_getfacl: Initialize acl pointer to NULL

PATCH In review Steve Dickson 1 participant 2 messages Nov 21, 2022 – Nov 22, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfs4_getfacl: Initialize acl pointer to NULL

nfs4_getfacl.c: scope_hint: In function 'print_acl_from_path' nfs4_getfacl.c:168:17: warning[-Wmaybe-uninitialized]:
'acl' may be used uninitialized in this function

---
 nfs4_getfacl/nfs4_getfacl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
nfs4_getfacl/nfs4_getfacl.c +1 -1
index 954cf7e..ddb3005 100644
@@ -148,7 +148,7 @@ out:
 
 static void print_acl_from_path(const char *fpath, enum acl_type type)
 {
-	struct nfs4_acl *acl;
+	struct nfs4_acl *acl = NULL;
 
 	switch (type) {
 	case ACL_TYPE_ACL:
Signature · 1 line
2.38.1
#1 lore raw
Quoted 5 lines · Steve Dickson

nfs4_getfacl.c: scope_hint: In function 'print_acl_from_path' nfs4_getfacl.c:168:17: warning[-Wmaybe-uninitialized]:
'acl' may be used uninitialized in this function

Committed... (tag: nfs4-acl-tools-0.4.3-rc1)

steved.

Quoted 17 lines
---
  nfs4_getfacl/nfs4_getfacl.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
nfs4_getfacl/nfs4_getfacl.c +1 -1
index 954cf7e..ddb3005 100644
@@ -148,7 +148,7 @@ out:
 
  static void print_acl_from_path(const char *fpath, enum acl_type type)
  {
-	struct nfs4_acl *acl;
+	struct nfs4_acl *acl = NULL;
 
  	switch (type) {
  	case ACL_TYPE_ACL: