【cppcheck】error: Common realloc mistake: 'tmp' nulled but not freed upon failure

はじめに C++の静的解析ツール「cppcheck」でソースコードを静的解析した場合に、以下の警告がでることがあります。 error: Common realloc mistake: 'tmp' nulled but not freed upon failure サンプルプログラム #include "stdafx.h" #include <Windows.h> int _tmain(int argc, _TCHAR* argv[]) { char *tmp; // メモリアロケート </windows.h>…