[libdvdnav-devel] [PATCH] Cleanup ifoFree()

Lawrence D'Oliveiro ldo at geek-central.gen.nz
Tue Jan 6 04:05:44 CET 2015


On Mon, 5 Jan 2015 19:31:49 -0700, Steve Dibb wrote:

>    if(strncmp("DVDVIDEO-VMG", vmgi_mat->vmg_identifier, 12) != 0) {
>      free(ifofile->vmgi_mat);
> -    ifofile->vmgi_mat = 0;
> +    ifofile->vmgi_mat = NULL;
>      return 0;
>    }

Umm, just a thought, shouldn’t that “!=” be “==”? strncmp(3) returns
zero on a match.

There’s another similar call comparing against "DVDVIDEO-VTS" elsewhere
in the same source file.

I don’t think this would cause crashes, but it would be leaking
memory. :)


More information about the libdvdnav-devel mailing list