[vlc-devel] commit: modules: Fix const char * usage and memory management. (Pierre d' Herbemont )

Pierre d'Herbemont pdherbemont at free.fr
Wed Apr 16 17:13:05 CEST 2008


On Apr 16, 2008, at 4:14 PM, Rémi Denis-Courmont wrote:

> Le mercredi 16 avril 2008, git version control a écrit :
>>     /* We strdup() these entries so that they are still valid when
>> the * module is unloaded. */
>> -    p_module->psz_object_name = strdup( p_module->psz_object_name );
>> +    /* This one is a (const char *) that will never get freed. */
>
> Hum? If a shared object is unloaded, its constant data section may  
> very
> well be unmapped.

True, I missed that. I am then considering to change vlc_object_t's  
psz_object_name to char *, and strdup() and free() it in objects.c.

>> +    p_module->psz_object_name = p_module->psz_object_name;
>
> Is this not a no-op???

It is, thanks for reporting, I missed it.

Pierre.


More information about the vlc-devel mailing list