[PATCH/RFC V2 15/26] library: Free zlib state

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

 



Signed-off-by: Kevin Cernekee <cernekee at gmail.com>
---
 library.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/library.c b/library.c
index 869f3d7..f4449a3 100644
--- a/library.c
+++ b/library.c
@@ -38,6 +38,7 @@
 #endif
 
 #include <libxml/tree.h>
+#include <zlib.h>
 
 #include "openconnect-internal.h"
 
@@ -179,7 +180,12 @@ void openconnect_vpninfo_free(struct openconnect_info *vpninfo)
 	if (vpninfo->oath_secret)
 		oath_done();
 #endif
-	/* No need to free deflate streams; they weren't initialised */
+
+	/* These check strm->state so they are safe to call multiple times */
+	inflateEnd(&vpninfo->inflate_strm);
+	deflateEnd(&vpninfo->deflate_strm);
+
+	free(vpninfo->deflate_pkt);
 	free(vpninfo);
 }
 
-- 
1.7.9.5




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux