What steps will reproduce the problem?
1. cppcheck -q -a -v -f -j2 gnome-mplayer-0.9.6/
2. [gnome-mplayer-0.9.6/src/support.c:340]: (error) Memory leak: file
The static code analysis tool complained about line 340.
Take a loop at line 340:
.....
FILE *fp;
gchar *file = NULL;
file = g_strndup(uri, 4);
if (strcmp(file, "file") != 0)
340 return 0; // FIXME: remote playlists unsuppored
.....
The function returns without freeing the memory.
A possible way to avoid this memory leak is:
FILE *fp;
gchar *file = NULL;
file = g_strndup(uri, 4);
if (strcmp(file, "file") != 0){
g_free(file);
return 0;
}
What version of the product are you using?
gnome-mplayer-0.9.6
On what operating system?
Ubuntu Linux(Jaunty,32-Bit,g++-4.3.2)
Best regards
Ettl Martin
Original issue reported on code.google.com by ettl.mar...@gmail.com on 15 Jun 2009 at 9:44
Original issue reported on code.google.com by
ettl.mar...@gmail.com
on 15 Jun 2009 at 9:44