diff options
author | Sander Vrijders <sander.vrijders@intec.ugent.be> | 2016-05-14 21:56:23 +0200 |
---|---|---|
committer | Sander Vrijders <sander.vrijders@intec.ugent.be> | 2016-05-14 21:56:23 +0200 |
commit | 43228f68f8e577015fe8116ab145fcc45ab789e7 (patch) | |
tree | 734e813ca51a588d078fb95ef74bd20953b28adc /src/lib/shm_ap_rbuff.c | |
parent | 32eed3193d2451e7cbdfb0b81e8d2d7e99cc5a31 (diff) | |
parent | e82a5c416673e1eb2fbafb1deaaa8ac07971215e (diff) | |
download | ouroboros-43228f68f8e577015fe8116ab145fcc45ab789e7.tar.gz ouroboros-43228f68f8e577015fe8116ab145fcc45ab789e7.zip |
Merged in dstaesse/ouroboros/dev-initialise (pull request #85)
lib: dev.c: added locking
Diffstat (limited to 'src/lib/shm_ap_rbuff.c')
-rw-r--r-- | src/lib/shm_ap_rbuff.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/shm_ap_rbuff.c b/src/lib/shm_ap_rbuff.c index 6c04ccc5..da6f0e33 100644 --- a/src/lib/shm_ap_rbuff.c +++ b/src/lib/shm_ap_rbuff.c @@ -253,8 +253,10 @@ struct rb_entry * shm_ap_rbuff_read(struct shm_ap_rbuff * rb) } e = malloc(sizeof(*e)); - if (e == NULL) + if (e == NULL) { + pthread_mutex_unlock(rb->shm_mutex); return NULL; + } *e = *(rb->shm_base + *rb->ptr_tail); |