[gmime-devel] [PATCH] free vstring where needed (thanks, Peter Bloomfield)



---
 tests/testsuite.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tests/testsuite.c b/tests/testsuite.c
index 103606b..2849d07 100644
--- a/tests/testsuite.c
+++ b/tests/testsuite.c
@@ -366,14 +366,17 @@ is_gpg_modern (void)
        vstring = NULL;
        
        if (getline (&vstring, &vlen, vpipe) == -1) {
+               free (vstring);
                pclose (vpipe);
                return 0;
        }
        
        pclose (vpipe);
        
-       if (strncmp (vstring, vheader, sizeof (vheader) - 1))
+       if (strncmp (vstring, vheader, sizeof (vheader) - 1)) {
+               free (vstring);
                return 0;
+       }
        
        ret = (vstring[sizeof (vheader) - 1] > '2') ||
                (vstring[sizeof (vheader) - 1] == '2' &&
-- 
2.10.2



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]