resolved: fix crash when shutting down

Reported by Cristian Rodríguez

http://lists.freedesktop.org/archives/systemd-devel/2015-May/031626.html
This commit is contained in:
Lennart Poettering
2015-05-18 23:23:17 +02:00
parent 6b7d2e9ea4
commit cab5b05903
6 changed files with 20 additions and 20 deletions
+4 -2
View File
@@ -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) {
+1 -1
View File
@@ -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);