diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-05-18 23:23:17 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-05-18 23:23:17 +0200 |
commit | cab5b05903096e1c9cf5575ccc73f89d15c8db69 (patch) | |
tree | 0900fc3bb29907617f784137ae91fb39948651ac /src/shared | |
parent | 6b7d2e9ea4cdb4cfa1512d37548a1a967623d7f2 (diff) |
resolved: fix crash when shutting down
Reported by Cristian RodrÃguez
http://lists.freedesktop.org/archives/systemd-devel/2015-May/031626.html
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/prioq.c | 6 | ||||
-rw-r--r-- | src/shared/prioq.h | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/shared/prioq.c b/src/shared/prioq.c index 8af4c51c2f..b89888be0e 100644 --- a/src/shared/prioq.c +++ b/src/shared/prioq.c @@ -45,12 +45,14 @@ Prioq *prioq_new(compare_func_t compare_func) { return q; } -void prioq_free(Prioq *q) { +Prioq* prioq_free(Prioq *q) { if (!q) - return; + return NULL; free(q->items); free(q); + + return NULL; } int prioq_ensure_allocated(Prioq **q, compare_func_t compare_func) { diff --git a/src/shared/prioq.h b/src/shared/prioq.h index d836b36cd9..1c044b135c 100644 --- a/src/shared/prioq.h +++ b/src/shared/prioq.h @@ -28,7 +28,7 @@ typedef struct Prioq Prioq; #define PRIOQ_IDX_NULL ((unsigned) -1) Prioq *prioq_new(compare_func_t compare); -void prioq_free(Prioq *q); +Prioq *prioq_free(Prioq *q); int prioq_ensure_allocated(Prioq **q, compare_func_t compare_func); int prioq_put(Prioq *q, void *data, unsigned *idx); |