chiark / gitweb /
journal: don't allow journal_file_open() to be called with ret being NULL
authorLennart Poettering <lennart@poettering.net>
Fri, 21 Sep 2012 14:16:39 +0000 (16:16 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 21 Sep 2012 14:16:39 +0000 (16:16 +0200)
src/journal/journal-file.c

index e778e1c..6db9955 100644 (file)
@@ -2012,6 +2012,7 @@ int journal_file_open(
         bool newly_created = false;
 
         assert(fname);
+        assert(ret);
 
         if ((flags & O_ACCMODE) != O_RDONLY &&
             (flags & O_ACCMODE) != O_RDWR)
@@ -2156,9 +2157,7 @@ int journal_file_open(
         if (r < 0)
                 goto fail;
 
-        if (ret)
-                *ret = f;
-
+        *ret = f;
         return 0;
 
 fail: