[systemd-commits] 6 commits - src/core src/journal src/login src/readahead src/shared

Zbigniew Jędrzejewski-Szmek zbyszek at kemper.freedesktop.org
Thu Aug 23 05:45:36 PDT 2012


 src/core/load-fragment.c          |    2 +-
 src/core/main.c                   |    5 +++--
 src/journal/sd-journal.c          |    1 +
 src/login/logind-inhibit.c        |   14 ++++++++++----
 src/readahead/readahead-analyze.c |    3 ++-
 src/shared/hashmap.c              |    3 +--
 6 files changed, 18 insertions(+), 10 deletions(-)

New commits:
commit f284860764076e2a1f0b34eb4c681bb2762f7889
Author: Lukas Nykryn <lnykryn at redhat.com>
Date:   Thu Aug 23 12:28:47 2012 +0200

    sd-journal: return null when mmap_cache_new fails

diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c
index 725c979..0f7c02c 100644
--- a/src/journal/sd-journal.c
+++ b/src/journal/sd-journal.c
@@ -1445,6 +1445,7 @@ static sd_journal *journal_new(int flags, const char *path) {
                 hashmap_free(j->directories_by_path);
                 free(j->path);
                 free(j);
+                return NULL;
         }
 
         return j;

commit 9f89986d2beb2c45436cc9e5b4da8bd4a79f100c
Author: Lukas Nykryn <lnykryn at redhat.com>
Date:   Thu Aug 23 12:21:55 2012 +0200

    hashmap: hashmap_contains does not need hashmap_entry

diff --git a/src/shared/hashmap.c b/src/shared/hashmap.c
index be37a36..0a044b8 100644
--- a/src/shared/hashmap.c
+++ b/src/shared/hashmap.c
@@ -380,14 +380,13 @@ void* hashmap_get(Hashmap *h, const void *key) {
 
 bool hashmap_contains(Hashmap *h, const void *key) {
         unsigned hash;
-        struct hashmap_entry *e;
 
         if (!h)
                 return false;
 
         hash = h->hash_func(key) % NBUCKETS;
 
-        if (!(e = hash_scan(h, hash, key)))
+        if (!hash_scan(h, hash, key))
                 return false;
 
         return true;

commit 403a56bf813014b111640ee804f6b1aa463ca15a
Author: Lukas Nykryn <lnykryn at redhat.com>
Date:   Mon Aug 20 15:15:40 2012 +0200

    readahead-analyze: don't call fclose on null

diff --git a/src/readahead/readahead-analyze.c b/src/readahead/readahead-analyze.c
index 11b2b2d..9a929c0 100644
--- a/src/readahead/readahead-analyze.c
+++ b/src/readahead/readahead-analyze.c
@@ -144,6 +144,7 @@ int main_analyze(const char *pack_path) {
         return EXIT_SUCCESS;
 
 fail:
-        fclose(pack);
+        if(pack)
+                fclose(pack);
         return EXIT_FAILURE;
 }

commit 032f81645b3a60be316d7a0ed1e84443aa8737ba
Author: Lukas Nykryn <lnykryn at redhat.com>
Date:   Mon Aug 20 14:52:07 2012 +0200

    core: free word later in parse_proc_cmdline

diff --git a/src/core/main.c b/src/core/main.c
index b50a1ca..12af3cd 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -727,12 +727,13 @@ static int parse_proc_cmdline(void) {
                 }
 
                 r = parse_proc_cmdline_word(word);
-                free(word);
-
                 if (r < 0) {
                         log_error("Failed on cmdline argument %s: %s", word, strerror(-r));
+                        free(word);
                         goto finish;
                 }
+
+                free(word);
         }
 
         r = 0;

commit a34faf579d2be139b0b9e8cd0c73ad4d918ef736
Author: Lukas Nykryn <lnykryn at redhat.com>
Date:   Mon Aug 20 14:39:08 2012 +0200

    login: check return of parse_pid and parse_uid

diff --git a/src/login/logind-inhibit.c b/src/login/logind-inhibit.c
index 96b7c6c..60b6237 100644
--- a/src/login/logind-inhibit.c
+++ b/src/login/logind-inhibit.c
@@ -219,11 +219,17 @@ int inhibitor_load(Inhibitor *i) {
         if  (mm >= 0)
                 i->mode = mm;
 
-        if (uid)
-                parse_uid(uid, &i->uid);
+        if (uid) {
+                r = parse_uid(uid, &i->uid);
+                if (r < 0)
+                        goto finish;
+        }
 
-        if (pid)
-                parse_pid(pid, &i->pid);
+        if (pid) {
+                r = parse_pid(pid, &i->pid);
+                if (r < 0)
+                        goto finish;
+        }
 
         if (who) {
                 cc = cunescape(who);

commit b5fb37899d34ec16f2a88dc3a8be3f4f7bf12ef3
Author: Lukas Nykryn <lnykryn at redhat.com>
Date:   Mon Aug 20 14:33:21 2012 +0200

    load-fragment: initialize bool invert before use

diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
index 9438aa3..c642261 100644
--- a/src/core/load-fragment.c
+++ b/src/core/load-fragment.c
@@ -2031,7 +2031,7 @@ int config_parse_syscall_filter(
 
         ExecContext *c = data;
         Unit *u = userdata;
-        bool invert;
+        bool invert = false;
         char *w;
         size_t l;
         char *state;



More information about the systemd-commits mailing list