mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-11 16:49:28 +02:00
Fix a memory leak based on Lioncash's patches.
This commit is contained in:
@ -299,7 +299,7 @@ bool Copy(const std::string &srcFilename, const std::string &destFilename)
|
|||||||
ERROR_LOG(COMMON,
|
ERROR_LOG(COMMON,
|
||||||
"Copy: failed reading from source, %s --> %s: %s",
|
"Copy: failed reading from source, %s --> %s: %s",
|
||||||
srcFilename.c_str(), destFilename.c_str(), GetLastErrorMsg());
|
srcFilename.c_str(), destFilename.c_str(), GetLastErrorMsg());
|
||||||
return false;
|
goto bail;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -310,13 +310,19 @@ bool Copy(const std::string &srcFilename, const std::string &destFilename)
|
|||||||
ERROR_LOG(COMMON,
|
ERROR_LOG(COMMON,
|
||||||
"Copy: failed writing to output, %s --> %s: %s",
|
"Copy: failed writing to output, %s --> %s: %s",
|
||||||
srcFilename.c_str(), destFilename.c_str(), GetLastErrorMsg());
|
srcFilename.c_str(), destFilename.c_str(), GetLastErrorMsg());
|
||||||
return false;
|
goto bail;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// close flushs
|
// close flushs
|
||||||
fclose(input);
|
fclose(input);
|
||||||
fclose(output);
|
fclose(output);
|
||||||
return true;
|
return true;
|
||||||
|
bail:
|
||||||
|
if (input)
|
||||||
|
fclose(input);
|
||||||
|
if (output)
|
||||||
|
fclose(output);
|
||||||
|
return false;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user