ecore_evas: Fix potential NULL dereference.

We don't want to execute any of the function below if t is NULL. Its not
only about strdup but alsa ecore_x_netwm_name_set which might dereference it.

CID 1039400
This commit is contained in:
Stefan Schmidt 2013-08-07 15:38:35 +01:00
parent 03c2d1c868
commit 91426926c5
1 changed files with 2 additions and 1 deletions

View File

@ -2587,7 +2587,8 @@ _ecore_evas_x_title_set(Ecore_Evas *ee, const char *t)
{
if (ee->prop.title) free(ee->prop.title);
ee->prop.title = NULL;
if (t) ee->prop.title = strdup(t);
if (!t) return;
ee->prop.title = strdup(t);
ecore_x_icccm_title_set(ee->prop.window, ee->prop.title);
ecore_x_netwm_name_set(ee->prop.window, ee->prop.title);
}