Commit 4ff1332b authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Fix handle and memory leaks on error

Found by cppcheck static analysis.

Version 0.07. Tagged as 'DDTLib-0_07'
parent 5360b8d1
/* (0.06)
/* (0.07)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.06
#define Module_MajorVersion_CMHG 0.07
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 10 Jan 2015
#define Module_Date_CMHG 02 Aug 2018
#define Module_MajorVersion "0.06"
#define Module_Version 6
#define Module_MajorVersion "0.07"
#define Module_Version 7
#define Module_MinorVersion ""
#define Module_Date "10 Jan 2015"
#define Module_Date "02 Aug 2018"
#define Module_ApplicationDate "10-Jan-15"
#define Module_ApplicationDate "02-Aug-18"
#define Module_ComponentName "DDTLib"
#define Module_ComponentPath "gpl/RiscOS/Sources/ThirdParty/JSmith/Lib/DDTLib"
#define Module_FullVersion "0.06"
#define Module_HelpVersion "0.06 (10 Jan 2015)"
#define Module_LibraryVersionInfo "0:6"
#define Module_FullVersion "0.07"
#define Module_HelpVersion "0.07 (02 Aug 2018)"
#define Module_LibraryVersionInfo "0:7"
......@@ -214,6 +214,7 @@ DDT_ddtinfo_handle DDT_LoadDDTInfoForFile( const char* filename)
if (!file)
{
/*fprintf( stderr, "Couldn't read image file '%s'\n", filename);*/
free( ddtdata);
return NULL;
}
......@@ -225,6 +226,8 @@ DDT_ddtinfo_handle DDT_LoadDDTInfoForFile( const char* filename)
if ( ddtdata->aifheader.size_debug == 0)
{
Desk_Debug2_Printf( "DDT_LoadDDTInfo - no debugging data in file\n");
fclose( file);
free( ddtdata);
return NULL;
}
......@@ -245,6 +248,8 @@ DDT_ddtinfo_handle DDT_LoadDDTInfoForFile( const char* filename)
if (!ddtdata->data)
{
/*fprintf( stderr, "Couldn't malloc space for debug info - %i bytes\n", global_ddtdata.aifheader.size_debug);*/
fclose( file);
free( ddtdata);
return NULL;
}
......
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