summaryrefslogtreecommitdiff
path: root/src/interface.c
diff options
context:
space:
mode:
authoratlaua <luchsmail-gh@yahoo.com>2011-09-29 16:54:32 (GMT)
committer atlaua <luchsmail-gh@yahoo.com>2011-09-29 16:54:32 (GMT)
commit946a492745a282411908a9d0611cc442bb4a1221 (patch)
tree042c2dab50c0a54114e04dba232333f5f355cce9 /src/interface.c
parent3ecb2ee39bd88066acaf89cafc94df802b9fd679 (diff)
downloadpowder-946a492745a282411908a9d0611cc442bb4a1221.zip
powder-946a492745a282411908a9d0611cc442bb4a1221.tar.gz
Bugfix: Fixed a segmentation fault in confirm_ui()
confirm_ui() free()ed its msg. This resulted in attemps to free const strings or and to invalid memoory accesses (because some other functions wanted to reuse the parameter which they gave to confirm_ui() after calling this function). Resolved by removing the call to free() from confirm_ui() and adding it after the calls to confirm_ui(9, if necessary.
Diffstat (limited to 'src/interface.c')
-rw-r--r--src/interface.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/interface.c b/src/interface.c
index 8bfaa3b..6998a94 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -1104,8 +1104,6 @@ int confirm_ui(pixel *vid_buf, char *top, char *msg, char *btn)
break;
}
- free(msg);
-
while (!sdl_poll())
{
b = SDL_GetMouseState(&mx, &my);
@@ -5568,6 +5566,8 @@ int save_filename_ui(pixel *vid_buf)
}
}
fclose(f);
+
+ free(filename);
}
}