api: fix string_expand_home SIGSEGV when HOME environment variable unset

v2.8-utf8proc
Simmo Saan 2016-10-20 23:24:50 +03:00
parent b51beb6766
commit bb22f2486b
1 changed files with 2 additions and 0 deletions

View File

@ -503,6 +503,8 @@ string_expand_home (const char *path)
}
ptr_home = getenv ("HOME");
if (!ptr_home)
return NULL;
length = strlen (ptr_home) + strlen (path + 1) + 1;
str = malloc (length);