Permalink
Browse files

[loadfile] ensure inputBuff is free'd in case we fail to read any data

  • Loading branch information...
1 parent 6e21f81 commit 1a2e6ae7fe86b1f0b2dff1efa0d9b30148c37562 Jonathan Marshall committed with May 13, 2013
Showing with 3 additions and 0 deletions.
  1. +3 −0 xbmc/utils/FileUtils.cpp
@@ -204,7 +204,10 @@ unsigned int CFileUtils::LoadFile(const std::string &filename, void* &outputBuff
file.Close();
if (total_read == 0)
+ {
+ free(inputBuff);
return 0;
+ }
outputBuffer = (void *) inputBuff;
return total_read;

0 comments on commit 1a2e6ae

Please sign in to comment.