summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri.staessens@ugent.be>2017-11-15 11:27:53 +0100
committerSander Vrijders <sander.vrijders@ugent.be>2017-11-15 11:40:30 +0100
commit197fb8504c51df4fdf0e7837b11d1aed2872e2da (patch)
tree4fe1c4ce191d7a10d1ab08b8ef7e885821dda6a1
parent91cbb32d3122dc9a63a5fdfc09d7c8822f95ddf6 (diff)
downloadouroboros-197fb8504c51df4fdf0e7837b11d1aed2872e2da.tar.gz
ouroboros-197fb8504c51df4fdf0e7837b11d1aed2872e2da.zip
ipcpd: Reset *dist on graph_routing_table fail
The *dist pointer was not reset on failure, causing the caller to try to free an unmalloced or already freed pointer. Reported-by: Nick Aerts <nick.aerts@ugent.be> Tested-by: Nick Aerts <nick.aerts@ugent.be> Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be> Signed-off-by: Sander Vrijders <sander.vrijders@ugent.be>
-rw-r--r--src/ipcpd/normal/pol/graph.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/ipcpd/normal/pol/graph.c b/src/ipcpd/normal/pol/graph.c
index eade23e0..a0af19f9 100644
--- a/src/ipcpd/normal/pol/graph.c
+++ b/src/ipcpd/normal/pol/graph.c
@@ -537,6 +537,7 @@ static int graph_routing_table_simple(struct graph * graph,
free_routing_table(table);
free(nhops);
fail_vertices:
+ *dist = NULL;
return -1;
}