Skip to content

Commit fe3bea0

Browse files
committed
Fix technically incorrect sizeof
This doesn't actually matter because both `*sal` and `**sal` are pointer sized, but this makes analysers happy. Fixes bug #68866. Closes GH-18816.
1 parent d11f971 commit fe3bea0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

main/network.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ PHPAPI int php_network_getaddresses(const char *host, int socktype, struct socka
227227
for (n = 1; (sai = sai->ai_next) != NULL; n++)
228228
;
229229

230-
*sal = safe_emalloc((n + 1), sizeof(*sal), 0);
230+
*sal = safe_emalloc((n + 1), sizeof(**sal), 0);
231231
sai = res;
232232
sap = *sal;
233233

@@ -266,7 +266,7 @@ PHPAPI int php_network_getaddresses(const char *host, int socktype, struct socka
266266
in = *((struct in_addr *) host_info->h_addr);
267267
}
268268

269-
*sal = safe_emalloc(2, sizeof(*sal), 0);
269+
*sal = safe_emalloc(2, sizeof(**sal), 0);
270270
sap = *sal;
271271
*sap = emalloc(sizeof(struct sockaddr_in));
272272
(*sap)->sa_family = AF_INET;

0 commit comments

Comments
 (0)