summaryrefslogtreecommitdiff
path: root/graphics/cinepaint/patches/patch-ak
blob: 3d5b86623707e17da066afe3cd625c4cf410fe87 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
$NetBSD: patch-ak,v 1.1 2005/03/16 18:32:50 rillig Exp $

gcc-2.95.3 cannot handle declarations intermixed with code.

--- app/fileops.c.orig	Tue Nov 23 12:58:14 2004
+++ app/fileops.c	Wed Mar 16 18:29:30 2005
@@ -2021,6 +2021,7 @@ file_temp_name(char *extension) 
     static gint pid;
 
     GString *s = g_string_new (NULL);
+    char *file_name;
 
     if (id == 0)
     {   pid = getpid();
@@ -2030,8 +2031,8 @@ file_temp_name(char *extension) 
 		      id++, extension);
 
 
-    char *file_name = strdup(s->str);  
-    g_string_free (s, FALSE);
+    file_name = strdup(s->str);   /* FIXME: possible null pointer access */
+    g_string_free (s, FALSE); /* FIXME: memory leak */
     return file_name;
 }