Browse Source

r.li.daemon: fix segfaults

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@49883 15284696-431f-4ddb-bdfa-cd5b030d7da7
Markus Metz 13 years ago
parent
commit
bb3e71d681
2 changed files with 5 additions and 1 deletions
  1. 4 0
      raster/r.li/r.li.daemon/daemon.c
  2. 1 1
      raster/r.li/r.li.daemon/list.c

+ 4 - 0
raster/r.li/r.li.daemon/daemon.c

@@ -59,7 +59,11 @@ int calculateIndex(char *file, int f(int, char **, area_des, double *),
     /* int perc=0; */
 
     g = (g_areas) G_malloc(sizeof(struct generatore));
+    g->maskname = NULL;
     l = (list) G_malloc(sizeof(struct lista));
+    l->head = NULL;
+    l->tail = NULL;
+    l->size = 0;
 
     worker_init(raster, f, parameters);
 

+ 1 - 1
raster/r.li/r.li.daemon/list.c

@@ -29,7 +29,7 @@ void insertNode(list l, msg mess)
 {
     node new;
 
-    new = G_malloc(sizeof(node));
+    new = G_malloc(sizeof(struct nodoLista));
     new->m = G_malloc(sizeof(msg));
 
     if (new != NULL) {