Skip to content

Commit 2c74b61

Browse files
committed
Fixed regularly crashes when using Ctrl+A in HEX editor
1 parent d74e149 commit 2c74b61

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/drivers/win/memview.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -297,9 +297,9 @@ void UndoLastPatch(){
297297
}
298298

299299
void GotoAddress(HWND hwnd) {
300-
char* gotoaddressstring = (char*)malloc(18);
300+
char* gotoaddressstring = (char*)malloc(8);
301301
int gotoaddress;
302-
char* gototitle = (char*)malloc(8);
302+
char* gototitle = (char*)malloc(18);
303303

304304
gotoaddressstring[0] = '\0';
305305
sprintf(gototitle, "%s%X%s", "Goto (0-", MaxSize-1, ")");
@@ -310,6 +310,8 @@ void GotoAddress(HWND hwnd) {
310310
SetHexEditorAddress(gotoaddress);
311311
}
312312
}
313+
free(gotoaddressstring);
314+
free(gototitle);
313315
}
314316

315317
void SetHexEditorAddress(int gotoaddress)

0 commit comments

Comments
 (0)