Fix problem with orig_path and rp

We have orig_path, it is set by rp. Only problem is that it was set
after efreet_desktop_read so the error handler would work as it should.
Wrong solution. So now we set orig_path to NULL, so we always can free
rp.

SVN revision: 46880
This commit is contained in:
Sebastian Dransfeld 2010-03-04 21:54:33 +00:00
parent 9328392a28
commit 30c305288f
1 changed files with 6 additions and 3 deletions

View File

@ -449,15 +449,18 @@ efreet_desktop_new(const char *file)
desktop = NEW(Efreet_Desktop, 1);
if (!desktop) goto error;
desktop->orig_path = strdup(file);
desktop->orig_path = rp;
if (!efreet_desktop_read(desktop)) goto error;
desktop->orig_path = rp;
desktop->ref = 1;
return desktop;
error:
if (desktop) efreet_desktop_free(desktop);
if (desktop)
{
desktop->orig_path = NULL;
efreet_desktop_free(desktop);
}
if (rp) free(rp);
return NULL;
}