Permalink
Browse files

Fix minor memory leak in MythUIButtonList::DistributeButtons() discov…

…ered by Coverity
  • Loading branch information...
stuartm committed May 9, 2012
1 parent a68210c commit 805cac52a07bb20933e9598f8c081aa4013ba788
Showing with 6 additions and 0 deletions.
  1. +6 −0 mythtv/libs/libmythui/mythuibuttonlist.cpp
@@ -832,7 +832,10 @@ bool MythUIButtonList::DistributeButtons(void)
first_item, last_item, selected_column,
skip_cols, grow_left, true, &col_widths,
height, 0, 0, col_cnt, wrapped))
+ {
+ delete[] col_widths;
return false;
+ }
m_columns = col_cnt;
@@ -865,7 +868,10 @@ bool MythUIButtonList::DistributeButtons(void)
first_item, last_item, selected_column,
skip_cols, grow_left, true, &col_widths,
height, 0, 0, col_cnt, wrapped))
+ {
+ delete[] col_widths;
return false;
+ }
}
if (selected_column != -1)

0 comments on commit 805cac5

Please sign in to comment.