1
1
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:
Lennart Poettering 2012-07-26 16:05:26 +02:00
parent b5dd874dda
commit 46b0d92225

View File

@ -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;