basic: check strdup result in khash_dup (#5176)

Fixes CID #1368249
This commit is contained in:
Evgeny Vereshchagin
2017-01-31 08:27:14 +01:00
committed by Martin Pitt
parent 70d940ec75
commit ef1fd941f9
+1 -1
View File
@@ -143,7 +143,7 @@ int khash_dup(khash *h, khash **ret) {
copy->fd = -1;
copy->algorithm = strdup(h->algorithm);
if (!copy)
if (!copy->algorithm)
return -ENOMEM;
copy->fd = accept4(h->fd, NULL, 0, SOCK_CLOEXEC);