telehash / telehash-c

telehash tools library in c
MIT License
122 stars 31 forks source link

New coverity issue #76

Closed jbdatko closed 9 years ago

jbdatko commented 9 years ago
  1. I'm noticing you are not incrementing the version number in version.h for all of these changes. We probably know the users of libtelehash but technically you are making changes to the library, which... is a different version.
  2. New error:

** CID 130929:  Memory - illegal accesses  (USE_AFTER_FREE)
/src/unix/util.c: 46 in util_fjson()

________________________________________________________________________________________________________
*** CID 130929:  Memory - illegal accesses  (USE_AFTER_FREE)
/src/unix/util.c: 46 in util_fjson()
40         return LOG("fread %d != %d for %s: %s",len,fs.st_size,file,strerror(errno));
41       }
42       
43       p = lob_new();
44       lob_head(p, buf, len);
45       free(buf);
>>>     CID 130929:  Memory - illegal accesses  (USE_AFTER_FREE)
>>>     Passing freed pointer "buf" as an argument to "util_sys_log".
46       if(!p) return LOG("json failed %s parsing %.*s",file,len,buf);
47       return p;
48     }
49     
50     mesh_t util_links(mesh_t mesh, char *file)
51     {