Message ID | 1257531264.18550.70.camel@auk31.llnl.gov (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
diff --git a/infiniband-diags/libibnetdisc/src/ibnetdisc.c b/infiniband-diags/libibnetdisc/src/ibnetdisc.c index 62dff93..7ce9a54 100644 --- a/infiniband-diags/libibnetdisc/src/ibnetdisc.c +++ b/infiniband-diags/libibnetdisc/src/ibnetdisc.c @@ -605,10 +605,12 @@ static void destroy_node(ibnd_node_t * node) { int p = 0; - for (p = 0; p <= node->numports; p++) { - free(node->ports[p]); + if (node->ports) { + for (p = 0; p <= node->numports; p++) { + free(node->ports[p]); + } + free(node->ports); } - free(node->ports); free(node); }