Merge pull request #2522 from pacovn/Coverity_1399277_Explicit_null_dereferenced

lib: null check (Coverity 1399277)
This commit is contained in:
Quentin Young 2018-06-21 14:18:47 -04:00 committed by GitHub
commit 1337a02851
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -46,6 +46,9 @@ int str2sockunion(const char *str, union sockunion *su)
{
int ret;
if (str == NULL)
return -1;
memset(su, 0, sizeof(union sockunion));
ret = inet_pton(AF_INET, str, &su->sin.sin_addr);