Fix possible heap use-after-free in workspace lib-linking

Caused by one of the recent commits during workspace review.
This commit is contained in:
Julian Eisel 2017-06-14 00:09:37 +02:00
parent c9de10a632
commit a394d68177
1 changed files with 2 additions and 1 deletions

View File

@ -2797,9 +2797,10 @@ static void lib_link_workspaces(FileData *fd, Main *bmain)
IDP_LibLinkProperty(id->properties, fd);
id_us_ensure_real(id);
for (WorkSpaceLayout *layout = layouts->first; layout; layout = layout->next) {
for (WorkSpaceLayout *layout = layouts->first, *layout_next; layout; layout = layout_next) {
bScreen *screen = newlibadr(fd, id->lib, BKE_workspace_layout_screen_get(layout));
layout_next = layout->next;
if (screen) {
BKE_workspace_layout_screen_set(layout, screen);