Commit cf3519b6 authored by Robert Sprowson's avatar Robert Sprowson

Fix memory leak on error

If 2nd malloc failed, 1st block was leaked.
Found by cppcheck static analysis.

Makefile tweaked to not use APP_OBJS so a debug target can also be built.

Version 0.57. Tagged as 'Squash-0_57'
parent 389aa7a2
......@@ -18,7 +18,7 @@
COMPONENT = Squash
TARGET = !RunImage
INSTTYPE = app
APP_OBJS = main squash debug
OBJS = main squash debug
CDFLAGS = -DDEBUG
LIBS = ${RLIB}
CINCLUDES = -IC:
......
/* (0.56)
/* (0.57)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.56
#define Module_MajorVersion_CMHG 0.57
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 26 Aug 2015
#define Module_Date_CMHG 26 Jun 2018
#define Module_MajorVersion "0.56"
#define Module_Version 56
#define Module_MajorVersion "0.57"
#define Module_Version 57
#define Module_MinorVersion ""
#define Module_Date "26 Aug 2015"
#define Module_Date "26 Jun 2018"
#define Module_ApplicationDate "26-Aug-15"
#define Module_ApplicationDate "26-Jun-18"
#define Module_ComponentName "Squash"
#define Module_ComponentPath "castle/RiscOS/Sources/Apps/Squash"
#define Module_FullVersion "0.56"
#define Module_HelpVersion "0.56 (26 Aug 2015)"
#define Module_LibraryVersionInfo "0:56"
#define Module_FullVersion "0.57"
#define Module_HelpVersion "0.57 (26 Jun 2018)"
#define Module_LibraryVersionInfo "0:57"
......@@ -183,12 +183,16 @@ static menu create_menu(void)
char *sprite = lookup_message("TaskSprite");
#endif
menu handle = menu_new(app_name, menutext);
if (handle == NULL) return NULL;
baricon(sprite, (int)resspr_area(), icon_click);
if (!event_attachmenu(win_ICONBAR, handle, menu_proc, 0))
return NULL;
menu_setflags(handle, 2, use_save_box, 0);
menu_setflags(handle, 3, squash_apps, 0);
if (handle != NULL) {
baricon(sprite, (int)resspr_area(), icon_click);
menu_setflags(handle, 2, use_save_box, 0);
menu_setflags(handle, 3, squash_apps, 0);
if (!event_attachmenu(win_ICONBAR, handle, menu_proc, 0)) {
menu_dispose(&handle, 1);
handle = NULL;
}
}
#ifndef RISCOS_200
free(sprite);
free(menutext);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment