Group :: Emulators
RPM: visualboyadvance-m
Main Changelog Spec Patches Sources Download Gear Bugs and FR Repocop
Patch: visualboyadvance-m-2.0.1-alt-segmentation-fault-fix.patch
Download
Download
diff --git a/src/wx/bin2c.c b/src/wx/bin2c.c
index 5c29737..dc28931 100644
--- a/src/wx/bin2c.c
+++ b/src/wx/bin2c.c
@@ -183,7 +183,10 @@ int main(int argc, const char** argv) {
if (argc >= 2) {
for (i = 0; i < (sizeof(usage_opts)/sizeof(char*)); i++) {
- if (!strcmp(argv[1], usage_opts[i])) exit_usage(0);
+ if (!strcmp(argv[1], usage_opts[i])) {
+ free(buf);
+ exit_usage(0);
+ }
}
for (i = 0; i < (sizeof(version_opts)/sizeof(char*)); i++) {
diff --git a/src/wx/wxvbam.cpp b/src/wx/wxvbam.cpp
index b3df41d..9f7a1cf 100644
--- a/src/wx/wxvbam.cpp
+++ b/src/wx/wxvbam.cpp
@@ -567,7 +567,10 @@ bool wxvbamApp::OnCmdLineParsed(wxCmdLineParser& cl)
}
wxvbamApp::~wxvbamApp() {
- free(home);
+ if(home){
+ free(home);
+ home=NULL;
+ }
}
MainFrame::MainFrame()
diff --git a/src/wx/wxvbam.h b/src/wx/wxvbam.h
index 28b1564..6420d37 100644
--- a/src/wx/wxvbam.h
+++ b/src/wx/wxvbam.h
@@ -16,6 +16,7 @@
#include "wx/sdljoy.h"
#include "wx/wxmisc.h"
#include "wxhead.h"
+
#ifndef NO_FFMPEG
#include "../common/ffmpeg.h"
#endif
@@ -81,6 +82,7 @@ public:
, pending_fullscreen(false)
, using_wayland(false)
{
+ home=NULL;
}
virtual bool OnInit();
virtual bool UsingWayland() { return using_wayland; }