chiark / gitweb /
macro: rework how we define cleanup macros
[elogind.git] / src / journal / test-journal-match.c
index fa228144f5ead7da9b75de5cd835f8c906db01d9..2ca2337c44a3f9fd480439967e3bf68737521738 100644 (file)
@@ -28,8 +28,8 @@
 #include "log.h"
 
 int main(int argc, char *argv[]) {
-        sd_journal *j;
-        char *t;
+        sd_journal _cleanup_journal_close_ *j;
+        char _cleanup_free_ *t;
 
         log_set_max_level(LOG_DEBUG);
 
@@ -59,9 +59,6 @@ int main(int argc, char *argv[]) {
         assert_se(streq(t, "((TWO=two AND (ONE=two OR ONE=one)) OR (PIFF=paff AND (QUUX=yyyyy OR QUUX=xxxxx OR QUUX=mmmm) AND (HALLO= OR HALLO=WALDO)))"));
 
         printf("resulting match expression is: %s\n", t);
-        free(t);
-
-        sd_journal_close(j);
 
         return 0;
 }