Exemplo n.º 1
0
Arquivo: sdp.c Projeto: krissg/junkie
static struct parser *sdp_parser_new(struct proto *proto, struct timeval const *now)
{
    MALLOCER(sdp_parsers);
    struct sdp_parser *sdp_parser = MALLOC(sdp_parsers, sizeof *sdp_parser);

    if (-1 == sdp_parser_ctor(sdp_parser, proto, now)) {
        FREE(sdp_parser);
        return NULL;
    }

    return &sdp_parser->parser;
}
Exemplo n.º 2
0
static struct parser *sdp_parser_new(struct proto *proto)
{
    struct sdp_parser *sdp_parser = objalloc_nice(sizeof *sdp_parser, "SDP parser");
    if (! sdp_parser) return NULL;

    if (-1 == sdp_parser_ctor(sdp_parser, proto)) {
        objfree(sdp_parser);
        return NULL;
    }

    return &sdp_parser->parser;
}