Lukáš Nykrýn píše v Čt 23. 08. 2012 v 09:25 +0200:
> Hello,
> Coverity found some new small issues between releases 185-188. See attached 
> patches.
> 
> Regards
> Lukas
> 
Hello,
Two more patches from diff scan 188-189.

Regards
Lukas

>From fb11041ccb2149381ebf9ddc7457b4e83dcdef41 Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnyk...@redhat.com>
Date: Thu, 23 Aug 2012 12:21:55 +0200
Subject: [PATCH 1/2] hashmap: hashmap_contains does not need hashmap_entry

---
 src/shared/hashmap.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

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;
-- 
1.7.6.5

>From deda3fd9c0c66ed6c143c4b20accf434c2f6a3a7 Mon Sep 17 00:00:00 2001
From: Lukas Nykryn <lnyk...@redhat.com>
Date: Thu, 23 Aug 2012 12:28:47 +0200
Subject: [PATCH 2/2] sd-journal: return null when mmap_cache_new fails

---
 src/journal/sd-journal.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

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;
-- 
1.7.6.5

_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to