Commit d30a840e authored by Jonathan Jenkins's avatar Jonathan Jenkins

lp-io segv fix

parent 549ca83d
...@@ -135,6 +135,13 @@ int lp_io_write_rev(tw_lpid gid, char* identifier){ ...@@ -135,6 +135,13 @@ int lp_io_write_rev(tw_lpid gid, char* identifier){
id->buffers_count--; id->buffers_count--;
id->buffers_total_size -= buf->size; id->buffers_total_size -= buf->size;
if (id->buffers_count == 0){
/* seg faults caused with empty identifiers for some reason - remove
* this ID */
identifiers = id->next;
free(id);
identifiers_count--;
}
/* remove the buffer from the list /* remove the buffer from the list
* (NULLs for end-of-list are preserved) */ * (NULLs for end-of-list are preserved) */
if (buf == id->buffers) { /* buf is head of list */ if (buf == id->buffers) { /* buf is head of list */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment