i3bar: ensure get_buffer does not leak memory
This fixes an AddressSanitizer warning which recently popped up. related to #2907
This commit is contained in:
parent
f54ee70ff9
commit
55964fb3be
|
@ -333,10 +333,12 @@ static unsigned char *get_buffer(ev_io *watcher, int *ret_buffer_len) {
|
|||
break;
|
||||
}
|
||||
ELOG("read() failed!: %s\n", strerror(errno));
|
||||
FREE(buffer);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (n == 0) {
|
||||
ELOG("stdin: received EOF\n");
|
||||
FREE(buffer);
|
||||
*ret_buffer_len = -1;
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue