diff options
author | Steven Toth <[email protected]> | 2016-10-24 10:10:50 -0400 |
---|---|---|
committer | Nicolai Hähnle <[email protected]> | 2016-11-07 18:31:52 +0100 |
commit | 5a58323064b32442e2de23c95642bc421be696f8 (patch) | |
tree | a72aec234ca160803679b275b52505103d386bcf /src/gallium/auxiliary/hud/hud_diskstat.c | |
parent | 6ffed086795aaa84ab35668bb59d712cdde34da3 (diff) |
gallium/hud: close a previously opened handle
We're missing the closedir() to the matching opendir().
Signed-off-by: Steven Toth <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/hud/hud_diskstat.c')
-rw-r--r-- | src/gallium/auxiliary/hud/hud_diskstat.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/hud/hud_diskstat.c b/src/gallium/auxiliary/hud/hud_diskstat.c index 7d4f5001a3d..d4306cdd95c 100644 --- a/src/gallium/auxiliary/hud/hud_diskstat.c +++ b/src/gallium/auxiliary/hud/hud_diskstat.c @@ -277,8 +277,10 @@ hud_get_num_disks(bool displayhelp) /* Add any partitions */ struct dirent *dpart; DIR *pdir = opendir(basename); - if (!pdir) + if (!pdir) { + closedir(dir); return 0; + } while ((dpart = readdir(pdir)) != NULL) { /* Avoid 'lo' and '..' and '.' */ @@ -298,6 +300,7 @@ hud_get_num_disks(bool displayhelp) add_object_part(basename, dpart->d_name, DISKSTAT_WR); } } + closedir(dir); if (displayhelp) { list_for_each_entry(struct diskstat_info, dsi, &gdiskstat_list, list) { |