[MPlayer-cvslog] r25689 - in trunk: codec-cfg.c codec-cfg.h libmpcodecs/dec_audio.c libmpcodecs/dec_video.c

Uoti Urpala uoti.urpala at pp1.inet.fi
Sat Jan 12 15:16:54 CET 2008


On Sat, 2008-01-12 at 15:05 +0100, reimar wrote:
> +void stringset_free(stringset_t *set) {
> +  free(*set);
> +  *set = NULL;
> +}
> +
> +void stringset_add(stringset_t *set, const char *str) {
> +  int count = 0;
> +  while ((*set)[count]) count++;
> +  count++;
> +  *set = realloc(*set, sizeof(char *) * (count + 1));
> +  (*set)[count - 1] = strdup(str);
> +  (*set)[count] = NULL;
> +}

Is there a need to strdup() the strings? The memory now allocated by
strdup is not freed anywhere.




More information about the MPlayer-cvslog mailing list