Fix various crashes.
authorIsmo Puustinen <ismo.puustinen@intel.com>
Fri, 12 Apr 2013 14:39:28 +0000 (17:39 +0300)
committerJaska Uimonen <jaska.uimonen@helsinki.fi>
Mon, 24 Jun 2013 10:44:44 +0000 (13:44 +0300)
murphy/multiplex.c
murphy/murphyif.c
murphy/router.c

index 4ffdfc4..8fa9956 100644 (file)
@@ -177,7 +177,7 @@ pa_muxnode *pa_multiplex_find_by_module(pa_multiplex *multiplex,
         module_index = module->index;
 
         PA_LLIST_FOREACH(mux, multiplex->muxnodes) {
-            if (module_index == mux->module_index)
+            if (mux->module_index != PA_IDXSET_INVALID && module_index == mux->module_index)
                 return mux;
         }
     }
index 20c5917..756337d 100644 (file)
@@ -370,7 +370,6 @@ void pa_murphyif_done(struct userdata *u)
 
         resource_transport_destroy(murphyif);
 
-        pa_xfree((void *)rif->atype);
         pa_hashmap_free(rif->nodes.rsetid, rset_hashmap_free, NULL);
         pa_hashmap_free(rif->nodes.pid, pid_hashmap_free, NULL);
 
@@ -1803,7 +1802,9 @@ static int node_put_rset(struct userdata *u, mir_node *node, rset_data *rset)
 
     pa_log_debug("setting rsetid %s for node %s", rset->id, node->amname);
 
-    pa_xfree(node->rsetid);
+    if (node->rsetid) {
+        pa_xfree(node->rsetid);
+    }
     node->rsetid = pa_xstrdup(rset->id);
 
     if (!(pl = get_node_proplist(u, node))) {
index 464f7fb..e1d0784 100644 (file)
@@ -704,15 +704,18 @@ static void rtgroup_update_module_property(struct userdata *u,
     pa_module *module;
     char       key[64];
     char       value[512];
+    int        ret;
 
     pa_assert(u);
     pa_assert(rtg);
+    pa_assert(rtg->name);
     pa_assert_se((module = u->module));
 
     snprintf(key, sizeof(key), PA_PROP_ROUTING_TABLE ".%s.%s",
              mir_direction_str(type), rtg->name);
-    rtgroup_print(rtg, value, sizeof(value));
+    ret = rtgroup_print(rtg, value, sizeof(value));
 
+    pa_assert(ret != 0);
     pa_proplist_sets(module->proplist, key, value+1); /* skip ' '@beginning */
 }