Skip to contentSkip to conversation

nfsv4/acl: Remove unneeded malloc(sizeof(FILE))

PATCH New Petr Vorel 1 participant 1 message Nov 17, 2019

lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

PATCH 1/1 nfsv4/acl: Remove unneeded malloc(sizeof(FILE))

FILE incomplete type under musl (comply C11 [1]). malloc(sizeof(FILE)) is not needed anyway, thus remove.

This fixes build on musl (at least):
acl1.c:51:23: error: invalid application of 'sizeof' to incomplete type 'FILE' {aka 'struct _IO_FILE'}
fptr = malloc(sizeof(FILE));

Fixes 618fd23eb ("Initial add of acl testsuite from Bull")

[1] https://www.openwall.com/lists/musl/2019/01/16/1

---
 testcases/network/nfsv4/acl/acl1.c | 1 -
 1 file changed, 1 deletion(-)
testcases/network/nfsv4/acl/acl1.c +0 -1
index bdf0180da..aae9484e5 100644
@@ -48,7 +48,6 @@ int do_file_op(char *filename)
 	result = 0;
 	FILE *fptr;
 	char str[256] = "./";
-	fptr = malloc(sizeof(FILE));
 
 	uid = geteuid();
 	strcat(str, filename);
Signature · 1 line
2.24.0