forked from enlightenment/efl
test_panel.c: fixed derefence null return value from getenv issue which was spotted by coverity. CID 1040025.
This commit is contained in:
parent
0e2b1b03ba
commit
3771cda12d
|
@ -93,11 +93,14 @@ _fill_list(Evas_Object *obj)
|
||||||
struct dirent *de;
|
struct dirent *de;
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
char *real;
|
char *real;
|
||||||
|
char *home_env = NULL;
|
||||||
unsigned int x = 0;
|
unsigned int x = 0;
|
||||||
|
|
||||||
if (!dirs)
|
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))
|
while ((de = readdir(d)) && (x < LIST_ITEM_MAX))
|
||||||
{
|
{
|
||||||
char buff[PATH_MAX];
|
char buff[PATH_MAX];
|
||||||
|
|
Loading…
Reference in New Issue