freesdp-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [freesdp-devel] Memory allocation-deallocation problems (no problem


From: Federico Montesino Pouzols
Subject: Re: [freesdp-devel] Memory allocation-deallocation problems (no problem in Linux)
Date: Fri, 28 Feb 2003 12:34:43 +0100
User-agent: Mutt/1.4i

        Hi, no these bugs (and some other similar ones) have not been
fixed in 0.4.3, though I would encourage you to upgrade, since it has
many fixes and new things. Thanks for pointing it out. I recall I
replaced some mallocs with callocs, but there are still a bunch of
malloc like these in parser.c, I will fix it a bit later today and
will make a 0.4.4 tarball available for download.

On Fri, Feb 28, 2003 at 12:14:51PM +0200, Dimitris Beletsiotis wrote:
> Hi,
> 
> I am trying to use FreeSDP-0.4.0 in VxWorks.
> I am encountering problems due to memory allocation-deallocation bugs, for
> example:
> 
> In common.c, fsdp_description_recycle function:
> 
> ---------------------------------------------------------------------
>   for ( i = 0; i < dsc->time_periods_count; i++ ) {
>     for ( j = 0; j < dsc->time_periods[i]->repeats_count; j++ ) {
>       free(dsc->time_periods[i]->repeats[j]->offsets);
>       free(dsc->time_periods[i]->repeats[j]);
>     }
>     free(dsc->time_periods[i]->repeats);
>     free(dsc->time_periods[i]);
>   }
>   free(dsc->time_periods);
> ---------------------------------------------------------------------
> 
> dsc->time_periods[i]->repeats pointers are freed even if there are no "r="
> lines.
> In parser.c, fsdp_parse function, memory is being allocated to these
> pointers only if "r=" lines exist.
> 
> I had also problems during the deallocation of pointers pointing to non-NULL
> addresses.
> To overcome these problem I changed the following malloc calls (in parser.c)
> to calloc:
> 
> ---------------------------------------------------------------------
> /*
>     dsc->time_periods[j] = malloc(sizeof(fsdp_time_period_t));
> */
>     dsc->time_periods[j] = calloc(1, sizeof(fsdp_time_period_t));
> 
> /*
>     dsc->time_periods[j] = malloc(sizeof(fsdp_time_period_t));
> */
>     dsc->time_periods[j] = calloc(1, sizeof(fsdp_time_period_t));
> 
> /*
>         malloc(sizeof(fsdp_media_announcement_t));
> */
>         calloc(1,sizeof(fsdp_media_announcement_t));
> ---------------------------------------------------------------------
> 
> I have not checked if these problems have been solved in newer versions,
> sorry about this.
> 
> Regards,
> 
> Dimitris Beletsiotis
> Embedded Systems Engineer
> 
> INTRACOM S.A.
> 
> 
> 
> _______________________________________________
> freesdp-devel mailing list
> address@hidden
> http://mail.nongnu.org/mailman/listinfo/freesdp-devel




reply via email to

[Prev in Thread] Current Thread [Next in Thread]