LCDproc development and user support list

Text archives Help

[Lcdproc] [patch] fix memleak in picolcd

Chronological Thread 
  • From: npavel AT (Nicu Pavel)
  • Subject: [Lcdproc] [patch] fix memleak in picolcd
  • Date: Fri Nov 16 22:07:01 2007


I attached a small patch that fixes a memory leak in picolcd driver in
picoLCD_get_key function.

Please apply.

Also we will have another LCD product a 20x4 character LCD but
hardware and usb communication has changed.
What will be the best way to integrate the new driver in lcdproc:

1. Add a new set of functions in picolcd.c or
2. Make a new driver picolcd2.c which will work for the new device

Nicu Pavel.
diff -urN lcdproc-cvs/server/drivers/picolcd.c lcdproc-cvs-memleak-patch/server/drivers/picolcd.c
--- lcdproc-cvs/server/drivers/picolcd.c	2007-10-08 18:53:45.000000000 +0300
+++ lcdproc-cvs-memleak-patch/server/drivers/picolcd.c	2007-11-16 23:43:30.000000000 +0200
@@ -535,12 +535,13 @@
 		} else {
 			debug(RPT_DEBUG, "picolcd: get_key got non-key data or timeout");
 			/* We got IR or otherwise bad data */
+			free(keydata);
 			return NULL;
-   free(keydata);
+	free(keydata);
 	debug(RPT_DEBUG, "picolcd: get_key complete (%s)", keystr);

Archive powered by MHonArc 2.6.18.

Top of page