Merge pull request #2911 from i3/asan
i3bar: ensure get_buffer does not leak memory
This commit is contained in:
commit
448af7ce5f
|
@ -1,5 +1,8 @@
|
||||||
sudo: false
|
sudo: false
|
||||||
dist: trusty
|
dist: trusty
|
||||||
|
# TODO: remove “group” once trusty kernel is no longer affected by
|
||||||
|
# https://github.com/google/sanitizers/issues/837
|
||||||
|
group: deprecated-2017Q3
|
||||||
services:
|
services:
|
||||||
- docker
|
- docker
|
||||||
language: c
|
language: c
|
||||||
|
|
|
@ -333,10 +333,12 @@ static unsigned char *get_buffer(ev_io *watcher, int *ret_buffer_len) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
ELOG("read() failed!: %s\n", strerror(errno));
|
ELOG("read() failed!: %s\n", strerror(errno));
|
||||||
|
FREE(buffer);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
if (n == 0) {
|
if (n == 0) {
|
||||||
ELOG("stdin: received EOF\n");
|
ELOG("stdin: received EOF\n");
|
||||||
|
FREE(buffer);
|
||||||
*ret_buffer_len = -1;
|
*ret_buffer_len = -1;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue