瀏覽代碼

Merge pull request #626 from Ragora/bugfix-codechecker-warnings

BugFix: Correct a few memory leaks
Brian Roberts 3 年之前
父節點
當前提交
ce9f2e51e0
共有 2 個文件被更改,包括 4 次插入1 次删除
  1. 3 1
      Engine/source/core/util/str.h
  2. 1 0
      Engine/source/gfx/bitmap/loaders/bitmapTga.cpp

+ 3 - 1
Engine/source/core/util/str.h

@@ -361,7 +361,9 @@ class StringBuilder
       {
          va_list args;
          va_start(args, fmt);
-         return mFormat.formatAppend(fmt, args);
+         const S32 result = mFormat.formatAppend(fmt, args);
+         va_end(args);
+         return result;
       }
 };
 

+ 1 - 0
Engine/source/gfx/bitmap/loaders/bitmapTga.cpp

@@ -471,6 +471,7 @@ static bool sReadTGA(Stream &stream, GBitmap *bitmap)
 
    default:
        //Con::errorf( "Unknown image type" );
+      delete[] colormap;
       return false;
    }