These patches fixes some simple errors found with cppcheck.

>From 655cd68f639845007bbad5c55e102fb977cb1ec9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aurimas=20Fi=C5=A1eras?= <auri...@gmail.com>
Date: Sat, 1 Jan 2011 14:14:36 +0200
Subject: Fix a memory leak (cppcheck)

---
 channels/cliprdr/cliprdr_x11.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/channels/cliprdr/cliprdr_x11.c b/channels/cliprdr/cliprdr_x11.c
index 5a35718..bb47fd3 100644
--- a/channels/cliprdr/cliprdr_x11.c
+++ b/channels/cliprdr/cliprdr_x11.c
@@ -622,6 +622,7 @@ clipboard_process_requested_html(struct clipboard_data * cdata,
 	memcpy(outbuf + 43, num, 10);
 
 	*length = strlen(outbuf) + 1;
+	free(inbuf);
 	return outbuf;
 }
 #endif
-- 
1.7.2.3



>From 1137de83583d7be3e04370b044aba55267bfba08 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aurimas=20Fi=C5=A1eras?= <auri...@gmail.com>
Date: Sat, 1 Jan 2011 14:17:49 +0200
Subject: Fix a resource leak (cppcheck)

---
 channels/rdpdr/printer/printer_main.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/channels/rdpdr/printer/printer_main.c b/channels/rdpdr/printer/printer_main.c
index 993c1dd..e5bb75d 100644
--- a/channels/rdpdr/printer/printer_main.c
+++ b/channels/rdpdr/printer/printer_main.c
@@ -100,6 +100,7 @@ printer_get_data(const char * name, int * len)
 		buf = (char *) malloc(*len);
 		memset(buf, 0, *len);
 		i = fread(buf, 1, *len, fp);
+		fclose(fp);
 	}
 	free(filename);
 	return buf;
-- 
1.7.2.3



>From 62300d09a40b5825c4a0faceb813f9d7c9de7869 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aurimas=20Fi=C5=A1eras?= <auri...@gmail.com>
Date: Sat, 1 Jan 2011 14:38:19 +0200
Subject: Remove unused variable (cppcheck)

---
 libfreerdp/credssp.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/libfreerdp/credssp.c b/libfreerdp/credssp.c
index 995be00..f481a02 100644
--- a/libfreerdp/credssp.c
+++ b/libfreerdp/credssp.c
@@ -92,7 +92,6 @@ void credssp_send(rdpSec * sec, STREAM s)
 {
 	TSRequest_t *ts_request;
 	OCTET_STRING_t *nego_token;
-	NegotiationToken_t *negotiation_token;
 	asn_enc_rval_t enc_rval;
 
 	char* buffer;
@@ -101,7 +100,6 @@ void credssp_send(rdpSec * sec, STREAM s)
 	ts_request = calloc(1, sizeof(TSRequest_t));
 	ts_request->negoTokens = calloc(1, sizeof(NegoData_t));
 	nego_token = calloc(1, sizeof(OCTET_STRING_t));
-	negotiation_token = calloc(1, sizeof(NegotiationToken_t));
 
 	ts_request->version = 2;
 
-- 
1.7.2.3



>From abe7b29590c1718030fe83994fd8802aa8718f48 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aurimas=20Fi=C5=A1eras?= <auri...@gmail.com>
Date: Sat, 1 Jan 2011 14:41:39 +0200
Subject: Fix a resource leak (cppcheck)

---
 libfreerdpkbd/libfreerdpkbd.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/libfreerdpkbd/libfreerdpkbd.c b/libfreerdpkbd/libfreerdpkbd.c
index 39522b0..f038c32 100644
--- a/libfreerdpkbd/libfreerdpkbd.c
+++ b/libfreerdpkbd/libfreerdpkbd.c
@@ -393,6 +393,7 @@ detect_keyboard_type_and_layout_sunos(char* xkbfile, int length)
 			layout = atoi(beg);
 		}
         }
+	pclose(kbd);
 
 	for(i = 0; i < sizeof(SunOSKeyboards) / sizeof(SunOSKeyboard); i++)
 	{
-- 
1.7.2.3



>From 51cf3fd0ae0fdf02863ad4794c13375edb703cf9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aurimas=20Fi=C5=A1eras?= <auri...@gmail.com>
Date: Sat, 1 Jan 2011 14:44:02 +0200
Subject: Fix a resource leak (cppcheck)
 Fix a memory leak (cppcheck)

---
 uiports/qtwin.cpp |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/uiports/qtwin.cpp b/uiports/qtwin.cpp
index e1ca0f9..1f8b1a5 100755
--- a/uiports/qtwin.cpp
+++ b/uiports/qtwin.cpp
@@ -1470,18 +1470,19 @@ int load_licence(uint8 ** data)
                           sizeof("/.rdesktop/licence."));
   sprintf(path, "%s/.rdesktop/licence.%s", home, g_hostname);
   fd = open(path, O_RDONLY);
+  xfree(path);
   if (fd == -1)
   {
     return -1;
   }
   if (fstat(fd, &st))
   {
+    close(fd);
     return -1;
   }
   *data = (uint8 *) xmalloc(st.st_size);
   length = read(fd, *data, st.st_size);
   close(fd);
-  xfree(path);
   return length;
 }
 
-- 
1.7.2.3



------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Freerdp-devel mailing list
Freerdp-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freerdp-devel

Reply via email to