fixed missing check for null after strdup in evutil_inet_pton_scope (#1366)

This commit is contained in:
Michael Madsen 2022-11-04 01:59:17 -07:00 committed by GitHub
parent 3ec3b469b8
commit ff99f67a1a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2248,7 +2248,9 @@ evutil_inet_pton_scope(int af, const char *src, void *dst, unsigned *indexp)
return 0;
}
*indexp = if_index;
tmp_src = mm_strdup(src);
if (!(tmp_src = mm_strdup(src)) {
return -1;
}
cp = strchr(tmp_src, '%');
*cp = '\0';
r = evutil_inet_pton(af, tmp_src, dst);