test_panel.c: fixed derefence null return value from getenv issue which was spotted by coverity. CID 1040025.

This commit is contained in:
Daniel Juyung Seo 2013-07-06 12:05:36 +09:00
parent 0e2b1b03ba
commit 3771cda12d
1 changed files with 4 additions and 1 deletions

View File

@ -93,11 +93,14 @@ _fill_list(Evas_Object *obj)
struct dirent *de;
Eina_List *l;
char *real;
char *home_env = NULL;
unsigned int x = 0;
if (!dirs)
{
if (!(d = opendir(getenv("HOME")))) return;
home_env = getenv("HOME");
if (!home_env) return;
if (!(d = opendir(home_env))) return;
while ((de = readdir(d)) && (x < LIST_ITEM_MAX))
{
char buff[PATH_MAX];