Fixed regularly crashes when using Ctrl+A in HEX editor

This commit is contained in:
Alexey 'Cluster' Avdyukhin 2021-06-28 08:57:53 +03:00
parent d74e14912d
commit 2c74b61bf9
1 changed files with 4 additions and 2 deletions

View File

@ -297,9 +297,9 @@ void UndoLastPatch(){
} }
void GotoAddress(HWND hwnd) { void GotoAddress(HWND hwnd) {
char* gotoaddressstring = (char*)malloc(18); char* gotoaddressstring = (char*)malloc(8);
int gotoaddress; int gotoaddress;
char* gototitle = (char*)malloc(8); char* gototitle = (char*)malloc(18);
gotoaddressstring[0] = '\0'; gotoaddressstring[0] = '\0';
sprintf(gototitle, "%s%X%s", "Goto (0-", MaxSize-1, ")"); sprintf(gototitle, "%s%X%s", "Goto (0-", MaxSize-1, ")");
@ -310,6 +310,8 @@ void GotoAddress(HWND hwnd) {
SetHexEditorAddress(gotoaddress); SetHexEditorAddress(gotoaddress);
} }
} }
free(gotoaddressstring);
free(gototitle);
} }
void SetHexEditorAddress(int gotoaddress) void SetHexEditorAddress(int gotoaddress)