aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/hud/hud_diskstat.c
diff options
context:
space:
mode:
authorEric Engestrom <[email protected]>2019-03-19 14:11:09 +0000
committerEric Engestrom <[email protected]>2019-04-04 13:59:24 +0000
commit4633d13854ffb64db476711afd97e00f60c4345a (patch)
treec43fe7a61d78bf2018d1eadbe44c5dac43f2eb73 /src/gallium/auxiliary/hud/hud_diskstat.c
parentb563460b494e9228cf5bb1aa4a70ac2499ad81fe (diff)
gallium/hud: fix memory leaks
Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/hud/hud_diskstat.c')
-rw-r--r--src/gallium/auxiliary/hud/hud_diskstat.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/hud/hud_diskstat.c b/src/gallium/auxiliary/hud/hud_diskstat.c
index 7eaaf35a7c7..6860567a26e 100644
--- a/src/gallium/auxiliary/hud/hud_diskstat.c
+++ b/src/gallium/auxiliary/hud/hud_diskstat.c
@@ -196,8 +196,10 @@ hud_diskstat_graph_install(struct hud_pane *pane, const char *dev_name,
else if (dsi->mode == DISKSTAT_WR) {
snprintf(gr->name, sizeof(gr->name), "%s-Write-MB/s", dsi->name);
}
- else
+ else {
+ free(gr);
return;
+ }
gr->query_data = dsi;
gr->query_new_value = query_dsi_load;