From c48d800e1527375235d7030199eb284228e4c55c Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Fri, 25 Mar 2011 17:51:10 +0000 Subject: [PATCH] * bucomm.c (make_tempname): Stop memory leak. ICVS: ---------------------------------------------------------------------- --- binutils/ChangeLog | 1 + binutils/bucomm.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/binutils/ChangeLog b/binutils/ChangeLog index d17deffb38b..1497663219e 100644 --- a/binutils/ChangeLog +++ b/binutils/ChangeLog @@ -19,6 +19,7 @@ (parse_stab_members): Likewise. (stab_demangle_qualified): Likewise. * objdump.c (dump_reloc_set): Free malloced memory. + * bucomm.c (make_tempname): Stop memory leak. 2011-03-25 Pierre Muller diff --git a/binutils/bucomm.c b/binutils/bucomm.c index 77afc1084a8..9977b50137f 100644 --- a/binutils/bucomm.c +++ b/binutils/bucomm.c @@ -511,7 +511,10 @@ make_tempname (char *filename) fd = open (tmpname, O_RDWR | O_CREAT | O_EXCL, 0600); #endif if (fd == -1) - return NULL; + { + free (tmpname); + return NULL; + } close (fd); return tmpname; } -- 2.30.2