[PATCH] wpp: fixed resource leakages (Coverity)
Marcus Meissner
marcus at jet.franken.de
Wed Oct 7 01:59:22 CDT 2009
Hi,
Fixed resource leakages on error case.
Ciao, Marcus
---
libs/wpp/wpp.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/libs/wpp/wpp.c b/libs/wpp/wpp.c
index a7597ec..6834df1 100644
--- a/libs/wpp/wpp.c
+++ b/libs/wpp/wpp.c
@@ -188,12 +188,16 @@ int wpp_parse_temp( const char *input, const char *output_base, char **output_na
if((fd = mkstemps( temp_name, 0 )) == -1)
{
ppy_error("Could not generate a temp name from %s\n", temp_name);
+ free( temp_name );
return 2;
}
if (!(output = fdopen(fd, "wt")))
{
ppy_error("Could not open fd %s for writing\n", temp_name);
+ close( fd );
+ unlink( temp_name );
+ free( temp_name );
return 2;
}
--
1.5.6
More information about the wine-patches
mailing list