Example #1
0
int parser_create( struct parser **pp )
{
    struct parser *p = NULL;
    int err = 0;

    p = (struct parser *)malloc(sizeof(struct parser));
    if ( !p ) {
        err = ENOMEM;
        goto out;
    }

    p->cb = NULL;
    p->userdata = NULL;

  out:

    if ( err ) {
        parser_dispose( p );
    } else {
        *pp = p;
    }

    return err;
}
Example #2
0
void t_teardown(){
	parser_dispose(&fix.parser);
}