[PATCH bitmap] Remove unused, leaky scanline.

Trevor Woerner twoerner at gmail.com
Sat Jan 8 17:15:50 PST 2011


From: Trevor Woerner <twoerner at gmail.com>

The pointer, scanline, doesn't appear to be used anymore, and is
leaking memory.

Signed-off-by: Trevor Woerner <twoerner at gmail.com>
---
 bmtoa.c |    7 -------
 1 files changed, 0 insertions(+), 7 deletions(-)

diff --git a/bmtoa.c b/bmtoa.c
index bdd2078..5e48776 100644
--- a/bmtoa.c
+++ b/bmtoa.c
@@ -180,19 +180,12 @@ print_scanline (unsigned int width,
 		unsigned char *data, 
 		char *chars)
 {
-    char *scanline = (char *) malloc (width + 1);
     unsigned char *dp = data;
     int row, column;
     static unsigned char masktable[] = {
 	0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 };
     int padded = ((width & 7) != 0);
 
-    if (!scanline) {
-	fprintf (stderr, "%s:  unable to allocate %d bytes for scanline\n",
-		 ProgramName, width + 1);
-	exit (1);
-    }
-
     for (row = 0; row < height; row++) {
 	for (column = 0; column < width; column++) {
 	    int i = (column & 7);
-- 
1.7.4.rc1.3.gbc2d1



More information about the xorg-devel mailing list