chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
journalctl: rework short output mode to rebuild full syslog message
[elogind.git]
/
src
/
util.c
diff --git
a/src/util.c
b/src/util.c
index d3d521b9280833518d793e293dbb24f14757fc16..2b735e8413bfeb7649c731a866de7c8bbfb8147c 100644
(file)
--- a/
src/util.c
+++ b/
src/util.c
@@
-6050,3
+6050,16
@@
finish:
return buf;
}
+
+void* memdup(const void *p, size_t l) {
+ void *r;
+
+ assert(p);
+
+ r = malloc(l);
+ if (!r)
+ return NULL;
+
+ memcpy(r, p, l);
+ return r;
+}