Fix memory leak in xstrdup

This commit is contained in:
Stanisław Wiśniewski 2023-09-03 21:44:11 +02:00 committed by GitHub
parent 36d225d71d
commit 39fcdffcfa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

2
st.c
View file

@ -280,8 +280,6 @@ xrealloc(void *p, size_t len)
char *
xstrdup(const char *s)
{
if ((s = strdup(s)) == NULL)
die("strdup: %s\n", strerror(errno));
char *p;
if ((p = strdup(s)) == NULL)