Skip to content

Commit

Permalink
Clean up the allocated gutter array before leaving in case of error
Browse files Browse the repository at this point in the history
  • Loading branch information
p-gen committed Apr 15, 2018
1 parent 0ff0326 commit f14dc77
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions smenu.c
Original file line number Diff line number Diff line change
Expand Up @@ -6047,7 +6047,17 @@ main(int argc, char * argv[])
free(w);

if (n > 1)
{
size_t j;

for (j = 0; j <= i; j++)
free(win.gutter_a[j]);

free(win.gutter_a);
free(gutter);

TELL("A multi columns gutter is not allowed -- ");
}

offset += mblen;
}
Expand Down

0 comments on commit f14dc77

Please sign in to comment.