diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-10-05 10:51:01 -0400 | 
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2017-10-05 10:53:13 -0400 | 
| commit | affe9e99831408960b8b6f8477506ed2874a05dd (patch) | |
| tree | a6f2f7a898fad5fcdc3f74b233095b6e8f6a2b46 /isisd/isis_route.c | |
| parent | ad183f047cab21576a42a9da0c4ed94cd1391005 (diff) | |
*: Convert list_delete(struct list *) to ** to allow nulling
Convert the list_delete(struct list *) function to use
struct list **.  This is to allow the list pointer to be nulled.
I keep running into uses of this list_delete function where we
forget to set the returned pointer to NULL and attempt to use
it and then experience a crash, usually after the developer
has long since left the building.
Let's make the api explicit in it setting the list pointer
to null.
Cynical Prediction:  This code will expose a attempt
to use the NULL'ed list pointer in some obscure bit
of code.
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'isisd/isis_route.c')
| -rw-r--r-- | isisd/isis_route.c | 4 | 
1 files changed, 2 insertions, 2 deletions
diff --git a/isisd/isis_route.c b/isisd/isis_route.c index ff17572ef9..b9605018ed 100644 --- a/isisd/isis_route.c +++ b/isisd/isis_route.c @@ -289,13 +289,13 @@ static void isis_route_info_delete(struct isis_route_info *route_info)  	if (route_info->nexthops) {  		route_info->nexthops->del =  			(void (*)(void *))isis_nexthop_delete; -		list_delete(route_info->nexthops); +		list_delete_and_null(&route_info->nexthops);  	}  	if (route_info->nexthops6) {  		route_info->nexthops6->del =  			(void (*)(void *))isis_nexthop6_delete; -		list_delete(route_info->nexthops6); +		list_delete_and_null(&route_info->nexthops6);  	}  	XFREE(MTYPE_ISIS_ROUTE_INFO, route_info);  | 
