wayland-cursor: Plug leak of filename on load_all_cursors_from_dir()
authorAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Tue, 19 Jun 2012 10:45:39 +0000 (13:45 +0300)
committerKristian Høgsberg <krh@bitplanet.net>
Tue, 19 Jun 2012 15:36:31 +0000 (11:36 -0400)
cursor/xcursor.c

index 360f7f3..0fe0440 100644 (file)
@@ -883,8 +883,10 @@ load_all_cursors_from_dir(const char *path, int size,
                        continue;
 
                f = fopen(full, "r");
-               if (!f)
+               if (!f) {
+                       free(full);
                        continue;
+               }
 
                images = XcursorFileLoadImages(f, size);
 
@@ -894,6 +896,7 @@ load_all_cursors_from_dir(const char *path, int size,
                }
 
                fclose (f);
+               free(full);
        }
 
        closedir(dir);