[commit: ghc] master: Fix memleak in hp2ps (f17dcf0)

git at git.haskell.org git at git.haskell.org
Sun Apr 27 11:45:48 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/f17dcf09a5797bbefe22aef7d4c508d1672484df/ghc

>---------------------------------------------------------------

commit f17dcf09a5797bbefe22aef7d4c508d1672484df
Author: Nicolas Trangez <ikke at nicolast.be>
Date:   Wed Apr 23 21:14:23 2014 +0200

    Fix memleak in hp2ps
    
    Issue discovered by Coverity scan, CID 43167.
    
    Signed-off-by: Austin Seipp <austin at well-typed.com>


>---------------------------------------------------------------

f17dcf09a5797bbefe22aef7d4c508d1672484df
 utils/hp2ps/HpFile.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/utils/hp2ps/HpFile.c b/utils/hp2ps/HpFile.c
index bdbf201..5ee9cc2 100644
--- a/utils/hp2ps/HpFile.c
+++ b/utils/hp2ps/HpFile.c
@@ -423,6 +423,8 @@ GetString(FILE *infp)
     stringbuffer[i] = '\0'; 
     thestring = copystring(stringbuffer);
 
+    free(stringbuffer);
+
     ASSERT(ch == '\"');
 
     ch = getc(infp);      /* skip the '\"' that terminates the string */



More information about the ghc-commits mailing list