diff options
author | Sander Vrijders <[email protected]> | 2017-08-29 13:14:25 +0200 |
---|---|---|
committer | Sander Vrijders <[email protected]> | 2017-08-29 13:14:25 +0200 |
commit | 4de841c26b7208d5395da349ea16c937b1361414 (patch) | |
tree | d86a1c02b36cfc5feea1ba5f22c6899f8a6c0c9c /src/lib/shm_rdrbuff.c | |
parent | e8875c08ac04a1d9aca342d94d4f788239334f72 (diff) | |
download | ouroboros-4de841c26b7208d5395da349ea16c937b1361414.tar.gz ouroboros-4de841c26b7208d5395da349ea16c937b1361414.zip |
lib, ipcpd, irmd: Fix bugs reported by static analysis
This fixes several bugs as reported by the clang static analyzer.
Diffstat (limited to 'src/lib/shm_rdrbuff.c')
-rw-r--r-- | src/lib/shm_rdrbuff.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/shm_rdrbuff.c b/src/lib/shm_rdrbuff.c index 447f8b35..d8893677 100644 --- a/src/lib/shm_rdrbuff.c +++ b/src/lib/shm_rdrbuff.c @@ -147,8 +147,10 @@ struct shm_rdrbuff * shm_rdrbuff_create() return NULL; rdrb = malloc(sizeof *rdrb); - if (rdrb == NULL) + if (rdrb == NULL) { + free(shm_rdrb_fn); return NULL; + } mask = umask(0); @@ -227,8 +229,10 @@ struct shm_rdrbuff * shm_rdrbuff_open() return NULL; rdrb = malloc(sizeof *rdrb); - if (rdrb == NULL) + if (rdrb == NULL) { + free(shm_rdrb_fn); return NULL; + } shm_fd = shm_open(shm_rdrb_fn, O_RDWR, 0666); if (shm_fd < 0) { |