File: 03-cppcheck.patch

package info (click to toggle)
fenix-plugins 0.0.20070803-9
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 36,560 kB
  • sloc: sh: 8,765; ansic: 3,031; xml: 413; makefile: 214
file content (50 lines) | stat: -rw-r--r-- 895 bytes parent folder | download | duplicates (2)
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
Description: Fix a couple of memory leaks.
Forwarded: no
Author: Peter Pentchev <roam@ringlet.net>
Last-Update: 2019-02-13

--- a/mixer-1.0/wav.c
+++ b/mixer-1.0/wav.c
@@ -131,6 +131,7 @@
 
 					if (wFormatTag!=1) {
 						file_close_mixer(fp);
+						free (signal);
 						return NULL;
 					}
 
@@ -147,12 +148,14 @@
 
 			} else {
 				file_close_mixer (fp);
+				free (signal);
 				return NULL;
 			}
 
 		} else {
 
 			file_close_mixer (fp);
+			free (signal);
 			return NULL;
 
 		}
--- a/ttf-1.0/ttf.c
+++ b/ttf-1.0/ttf.c
@@ -142,13 +142,15 @@
 			break;
 
 		allocated += 4096;
-		buffer = realloc (buffer, allocated);
-		if (buffer == NULL)
+		char * const new_buffer = realloc (buffer, allocated);
+		if (new_buffer == NULL)
 		{
 			gr_error ("gr_load_ttf: sin memoria");
 			file_close (fp);
+			free (buffer);
 			return -1;
 		}
+		buffer = new_buffer;
 	}
 	file_close(fp);