On Tue, Aug 29, 2017 at 05:52:34AM +0000, matthew green wrote: > @@ -175,6 +179,9 @@ insert( uint16_t vendor ) > struct pci_id_node * child = > calloc( 1, sizeof( struct pci_id_node ) ); > > + if ( tree == NULL ) > + return NULL; > + > child->bits = 4; > > n->children[ idx ] = child; > @@ -183,6 +190,9 @@ insert( uint16_t vendor ) > struct pci_id_leaf * leaf = > calloc( 1, sizeof( struct pci_id_leaf ) ); > > + if ( tree == NULL ) > + return NULL; > + > leaf->vendor = vendor; >
should check child & leaf instead, I think