File: fix-malloc-device-name-node.diff

package info (click to toggle)
lingot 1.1.1-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,284 kB
  • sloc: ansic: 6,746; makefile: 164; xml: 49; sh: 16
file content (26 lines) | stat: -rw-r--r-- 1,137 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
Description: fix the size allocated for struct device_name_node_t
Forwarded: https://savannah.nongnu.org/bugs/index.php?65715
Author: Nicolas Boulenguez <nicolas@debian.org>

--- a/src/lingot-audio-alsa.c
+++ b/src/lingot-audio-alsa.c
@@ -355,7 +355,7 @@
                         }
 
                         result->n_devices++;
-                        struct device_name_node_t* new_name_node = (struct device_name_node_t*) malloc(sizeof(struct device_name_node_t*));
+                        struct device_name_node_t* new_name_node = (struct device_name_node_t*) malloc(sizeof(struct device_name_node_t));
                         new_name_node->name = _strdup(device_name);
                         new_name_node->next = NULL;
 
--- a/src/lingot-audio-pulseaudio.c
+++ b/src/lingot-audio-pulseaudio.c
@@ -339,7 +339,7 @@
     //	printf("\tlags %i\n", i->flags);
 
     struct device_name_node_t* new_name_node = (struct device_name_node_t*)
-            malloc(sizeof(struct device_name_node_t*));
+            malloc(sizeof(struct device_name_node_t));
 
     new_name_node->name = _strdup(buff);
     new_name_node->next = NULL;