Fix missing return statement identified by lgtm

This commit is contained in:
Dennis Heimbigner 2018-04-23 10:54:44 -06:00 committed by GitHub
parent ee0086f16a
commit 867e51145b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,13 +57,15 @@ chkrealloc(void* ptr, size_t size)
char*
chkstrdup(const char* s)
{
char* dup = strdup(s);
char* dup;
if(s == NULL) {
panic("strdup: null argument");
}
dup = strdup(s);
if(dup == NULL) {
panic("strdup: out of memory");
}
return dup;
}
int