Assign rp to orig_path after last goto error

This will fix the double free problem

SVN revision: 46841
This commit is contained in:
Sebastian Dransfeld 2010-03-03 20:13:13 +00:00
parent 7a07bed86c
commit 22a691b5e9
1 changed files with 2 additions and 8 deletions

View File

@ -447,21 +447,15 @@ efreet_desktop_new(const char *file)
desktop = NEW(Efreet_Desktop, 1);
if (!desktop) goto error;
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);
// this is not ideal as it will leak, but we are getting a double-free here
// for some reason that I can't see right now. so disable the free call
// here until this gets investigated. Better than having the desktop die
// because someone tried to open the menu - dh
// if (rp) free(rp);
if (rp) free(rp);
return NULL;
}