mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-23 17:34:00 +03:00
logs-show: fix OOM path
This commit is contained in:
parent
b5dd874dda
commit
46b0d92225
@ -50,11 +50,12 @@ static int parse_field(const void *data, size_t length, const char *field, char
|
||||
|
||||
nl = length - fl;
|
||||
buf = malloc(nl+1);
|
||||
memcpy(buf, (const char*) data + fl, nl);
|
||||
((char*)buf)[nl] = 0;
|
||||
if (!buf)
|
||||
return log_oom();
|
||||
|
||||
memcpy(buf, (const char*) data + fl, nl);
|
||||
((char*)buf)[nl] = 0;
|
||||
|
||||
free(*target);
|
||||
*target = buf;
|
||||
*target_size = nl;
|
||||
|
Loading…
Reference in New Issue
Block a user