[asterisk-dev] Problems with ast_realloc Version 1.4.5

Alvaro Parres aparres at gmail.com
Sun Jun 24 12:03:44 CDT 2007


I have change my alloca for a malloc and that solves the problem

Thanks for my self.


On 6/24/07, Alvaro Parres <aparres at gmail.com> wrote:
>
> Hi list i'm having some problems with the ast_realloac function
>
>
> I have this code:
>
>                    char *temporal;
>                    temporal = alloca(20);
>                    memset(temporal,0,20);
>                    strcpy(temporal,"Hola");
>                    ast_verbose(VERBOSE_PREFIX_4 "Temporal: %s",temporal);
>                    temporal = (char *) ast_realloc(temporal,21);
>                    ast_verbose(VERBOSE_PREFIX_4 "Temporal: %s",temporal);
>
> And the output at the asterisk is
>
>      > Temporal: Hola
>      WARNING: Realloc of unalloced memory at 0xb65c4960, in ldapget_exec
> of app_ldap.c, line 194
>      > Temporal: (null)
>
> I don't know if any one of you can help me with this.
>
> Thanks.
>
> --
> Alvaro I. Parres Peredo
> Director de IT
> Grupo Xmarts SA de CV
> Tel: +52 (33) 35 63 6261 Ext. 112
>       01 800  087 2260
> Cel: +52 (33) 33 68 1087
> alvaro.parres at xmarts.com.mx




-- 
Alvaro I. Parres Peredo
Director de IT
Grupo Xmarts SA de CV
Tel: +52 (33) 35 63 6261 Ext. 112
      01 800  087 2260
Cel: +52 (33) 33 68 1087
alvaro.parres at xmarts.com.mx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-dev/attachments/20070624/e29d92d6/attachment.htm 


More information about the asterisk-dev mailing list