diff options
author | Steve Bennett <steveb@workware.net.au> | 2014-04-23 10:05:43 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2014-04-23 14:35:44 +1000 |
commit | a92eb84a32df63d31e9741bff83a8809f14afd4e (patch) | |
tree | 9c5d06a325d8f895825f255aa4ef2ce970fceba2 /jim-file.c | |
parent | 8cb7e5a255b03251840263eda4b0b8904dd39db3 (diff) | |
download | jimtcl-a92eb84a32df63d31e9741bff83a8809f14afd4e.zip jimtcl-a92eb84a32df63d31e9741bff83a8809f14afd4e.tar.gz jimtcl-a92eb84a32df63d31e9741bff83a8809f14afd4e.tar.bz2 |
file: avoid mem leak on mkstemp failure
Courtesy of coverity
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'jim-file.c')
-rw-r--r-- | jim-file.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -498,6 +498,7 @@ static int file_cmd_tempfile(Jim_Interp *interp, int argc, Jim_Obj *const *argv) fd = mkstemp(filename); if (fd < 0) { Jim_SetResultString(interp, "Failed to create tempfile", -1); + Jim_Free(filename); return JIM_ERR; } close(fd); |