strdup() name and class only if they are not NULL
authorcaro <caro@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sat, 24 Oct 2009 06:59:30 +0000 (06:59 +0000)
committercaro <caro@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sat, 24 Oct 2009 06:59:30 +0000 (06:59 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/ecore@43243 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/ecore_evas/ecore_evas_x.c

index 13caf84..045727d 100644 (file)
@@ -1739,8 +1739,8 @@ _ecore_evas_x_name_class_set(Ecore_Evas *ee, const char *n, const char *c)
    if (ee->prop.clas) free(ee->prop.clas);
    ee->prop.name = NULL;
    ee->prop.clas = NULL;
-   ee->prop.name = strdup(n);
-   ee->prop.clas = strdup(c);
+   if (n) ee->prop.name = strdup(n);
+   if (c) ee->prop.clas = strdup(c);
    ecore_x_icccm_name_class_set(ee->prop.window, ee->prop.name, ee->prop.clas);
 }