check NULL pointer

This commit is contained in:
c9s 2014-05-20 15:14:12 +08:00
parent af3cdbbff4
commit fd4e89c2f4

View file

@ -83,7 +83,7 @@ edge * r3_node_add_child(node * n, char * pat , node *child) {
void r3_node_append_edge(node *n, edge *e) { void r3_node_append_edge(node *n, edge *e) {
if (!n->edges) { if (n->edges == NULL) {
n->edge_cap = 3; n->edge_cap = 3;
n->edges = malloc(sizeof(edge) * n->edge_cap); n->edges = malloc(sizeof(edge) * n->edge_cap);
} }