summaryrefslogtreecommitdiff
path: root/src/shared/util.h
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-03-24 19:09:19 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-04-05 19:58:53 -0400
commitc84a94883161073239c35d181e25823ff0454f68 (patch)
tree64c6fbf807493f3d878fa53113ba857116de7393 /src/shared/util.h
parentb92bea5d2a9481de69bb627a7b442a9f58fca43d (diff)
Add _cleanup_globfree_
Fixes a memleak in error path in exec_context_load_environment.
Diffstat (limited to 'src/shared/util.h')
-rw-r--r--src/shared/util.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/shared/util.h b/src/shared/util.h
index 4c4aed583e..bea43fc4bc 100644
--- a/src/shared/util.h
+++ b/src/shared/util.h
@@ -37,8 +37,8 @@
#include <sys/resource.h>
#include <stddef.h>
#include <unistd.h>
-#include <systemd/sd-journal.h>
+#include <systemd/sd-journal.h>
#include "macro.h"
#include "time-util.h"
@@ -539,6 +539,8 @@ static inline void journal_closep(sd_journal **j) {
sd_journal_close(*j);
}
+#define _cleanup_globfree_ __attribute__((cleanup(globfree)))
+
_malloc_ static inline void *malloc_multiply(size_t a, size_t b) {
if (_unlikely_(b == 0 || a > ((size_t) -1) / b))
return NULL;