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:
+4
-2
@@ -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
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user