Revision: 9061
          http://playerstage.svn.sourceforge.net/playerstage/?rev=9061&view=rev
Author:   jpgr87
Date:     2011-07-07 00:01:18 +0000 (Thu, 07 Jul 2011)

Log Message:
-----------
Fixed sonar geom segfaults in readlog

Modified Paths:
--------------
    code/player/trunk/server/drivers/shell/readlog.cc

Modified: code/player/trunk/server/drivers/shell/readlog.cc
===================================================================
--- code/player/trunk/server/drivers/shell/readlog.cc   2011-07-06 23:48:52 UTC 
(rev 9060)
+++ code/player/trunk/server/drivers/shell/readlog.cc   2011-07-07 00:01:18 UTC 
(rev 9061)
@@ -501,8 +501,10 @@
 
     // if it's sonar, then make a spot to cache geometry info
     if(this->provide_ids[i].interf == PLAYER_SONAR_CODE)
-      assert((this->provide_metadata[i] =
-              calloc(sizeof(player_sonar_geom_t),1)));
+    {
+      this->provide_metadata[i] = calloc(sizeof(player_sonar_geom_t),1);
+      assert(this->provide_metadata[i]);
+    }
 
     // if it's localize, remember address
     if(this->provide_ids[i].interf == PLAYER_LOCALIZE_CODE){
@@ -2734,6 +2736,8 @@
             assert(geom);
 
             geom->poses_count = atoi(tokens[7]);
+            geom->poses = (player_pose3d_t*)calloc(geom->poses_count, 
sizeof(player_pose3d_t));
+
             int count = 0;
             for(int i=8;i<token_count;i+=3)
             {
@@ -2746,6 +2750,7 @@
             {
               PLAYER_ERROR2("range count mismatch at %s:%d",
                             this->filename, linenum);
+              free(geom->poses);
               free(geom);
               return -1;
             }


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to