mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-24 21:34:08 +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;
|
nl = length - fl;
|
||||||
buf = malloc(nl+1);
|
buf = malloc(nl+1);
|
||||||
memcpy(buf, (const char*) data + fl, nl);
|
|
||||||
((char*)buf)[nl] = 0;
|
|
||||||
if (!buf)
|
if (!buf)
|
||||||
return log_oom();
|
return log_oom();
|
||||||
|
|
||||||
|
memcpy(buf, (const char*) data + fl, nl);
|
||||||
|
((char*)buf)[nl] = 0;
|
||||||
|
|
||||||
free(*target);
|
free(*target);
|
||||||
*target = buf;
|
*target = buf;
|
||||||
*target_size = nl;
|
*target_size = nl;
|
||||||
|
Loading…
Reference in New Issue
Block a user