Ethumb: test if unique_name is not null, If I kill the daemon right after it is started, I have a segv. This patch fix it.

SVN revision: 43971
This commit is contained in:
Jonathan Atton 2009-11-25 12:43:27 +00:00
parent 521c89df41
commit 3cadaace4f
1 changed files with 4 additions and 2 deletions

View File

@ -252,6 +252,8 @@ _ethumb_client_name_owner_changed(void *data, DBusMessage *msg)
return;
}
if(!from || !name)
return ;
if (strcmp(name, _ethumb_dbus_bus_name) != 0)
return;
@ -260,10 +262,10 @@ _ethumb_client_name_owner_changed(void *data, DBusMessage *msg)
if (from[0] != '\0' && to[0] == '\0')
{
DBG("exit ethumbd at %s", from);
if (strcmp(client->unique_name, from) != 0)
if (client->unique_name && strcmp(client->unique_name, from) != 0)
WRN("%s was not the known name %s, ignored.",
from, client->unique_name);
else
else if(client->unique_name)
{
ERR("server exit!!!");
if (client->die.cb)