fix use after free when renaming a bryce

fix T4784
This commit is contained in:
Mike Blumenkrantz 2016-10-29 11:36:48 -04:00
parent 6ab8c48892
commit f8ddfd3245
1 changed files with 5 additions and 3 deletions

View File

@ -452,10 +452,12 @@ _bryce_rename(Bryce *b, int num)
snprintf(buf, sizeof(buf), "__bryce%s", name); snprintf(buf, sizeof(buf), "__bryce%s", name);
snprintf(buf2, sizeof(buf2), "__bryce%s_%d", name, num); snprintf(buf2, sizeof(buf2), "__bryce%s_%d", name, num);
e_gadget_site_rename(buf, buf2); e_gadget_site_rename(buf, buf2);
if (b->version >= 2)
{
snprintf(buf, sizeof(buf), "%s_%u", name, num);
eina_stringshare_replace(&b->name, buf);
}
free(name); free(name);
if (b->version < 2) return;
snprintf(buf, sizeof(buf), "%s_%u", name, num);
eina_stringshare_replace(&b->name, buf);
} }
static void static void