]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/import/export-raw.c
Add SPDX license identifiers to source files under the LGPL
[thirdparty/systemd.git] / src / import / export-raw.c
index 103d45bf218b2028130253d320144d52814cb72b..8485027b2b53ddc9123665feb80898e8f9dc7a1e 100644 (file)
@@ -1,5 +1,4 @@
-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
+/* SPDX-License-Identifier: LGPL-2.1+ */
 /***
   This file is part of systemd.
 
 ***/
 
 #include <sys/sendfile.h>
+
+/* When we include libgen.h because we need dirname() we immediately
+ * undefine basename() since libgen.h defines it as a macro to the POSIX
+ * version which is really broken. We prefer GNU basename(). */
 #include <libgen.h>
 #undef basename
 
@@ -32,6 +35,7 @@
 #include "fd-util.h"
 #include "fileio.h"
 #include "import-common.h"
+#include "missing.h"
 #include "ratelimit.h"
 #include "string-util.h"
 #include "util.h"
@@ -84,9 +88,7 @@ RawExport *raw_export_unref(RawExport *e) {
 
         free(e->buffer);
         free(e->path);
-        free(e);
-
-        return NULL;
+        return mfree(e);
 }
 
 int raw_export_new(