From: claudio Date: Sat, 19 Apr 2014 15:43:17 +0000 (+0000) Subject: Try to be clear why struct mrt_config nodes are allocated and X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=91941cb9d833072ac69d291778d87db9cd33aec5;p=openbsd Try to be clear why struct mrt_config nodes are allocated and assigned to struct mrt pointers. I may need to rethink this later but lets hope this does not confuse more people and analyzers. --- diff --git a/usr.sbin/bgpd/mrt.c b/usr.sbin/bgpd/mrt.c index 95026a0c2c1..f48d7f4e01d 100644 --- a/usr.sbin/bgpd/mrt.c +++ b/usr.sbin/bgpd/mrt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mrt.c,v 1.76 2013/11/13 20:41:01 benno Exp $ */ +/* $OpenBSD: mrt.c,v 1.77 2014/04/19 15:43:17 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Claudio Jeker @@ -986,10 +986,12 @@ mrt_mergeconfig(struct mrt_head *xconf, struct mrt_head *nconf) { struct mrt *m, *xm; + /* both lists here are actually struct mrt_conifg nodes */ LIST_FOREACH(m, nconf, entry) { if ((xm = mrt_get(xconf, m)) == NULL) { /* NEW */ - if ((xm = calloc(1, sizeof(struct mrt_config))) == NULL) + if ((xm = (struct mrt *)calloc(1, + sizeof(struct mrt_config))) == NULL) fatal("mrt_mergeconfig"); memcpy(xm, m, sizeof(struct mrt_config)); xm->state = MRT_STATE_OPEN;