RE: [PATCH] dlr.c

"Rene Kluwen" <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
Ah... I didn't know that cfg_get was sending a duplicate.
Nonetheless, the possible immutable shouldn't be destroyed. But I think that
octstr_destroy will take that into account.

== Rene

-----Original Message-----
From: Alexander Malysh [mailto:[email protected]] On Behalf Of
Alexander Malysh
Sent: woensdag 30 juni 2010 10:47
To: Rene Kluwen
Cc: [email protected]
Subject: Re: [PATCH] dlr.c

Hi,

-1 because you are wrong:
Octstr *cfg_get_real(CfgGroup *grp, Octstr *varname, const char *file,
                     long line, const char *func)
{
    Octstr *os;

    if(grp == NULL)
        panic(0, "Trying to fetch variable `%s' in non-existing group",
              octstr_get_cstr(varname));

    if (grp->name != NULL && !is_allowed_in_group(grp->name, varname))
        panic(0, "Trying to fetch variable `%s' in group `%s', not
allowed.",
              octstr_get_cstr(varname), octstr_get_cstr(grp->name));

    os = dict_get(grp->vars, varname);
    if (os == NULL)
        return NULL;
    return gw_claim_area_for(octstr_duplicate(os), file, line, func);
}

Thanks,
Alexander Malysh

Am 29.06.2010 um 20:43 schrieb Rene Kluwen:

> The octstr_destroy(dlr_type); in dlr.c is a bug. It shouldn't be there,
> since dlr_type is either an immutable or a string got from cfg_get.
> 
> == Rene
> <dlr_bug.diff>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.