Browse Source

Fixes a use-after-free

tags/v1.3.1000
Mathias Buhr 8 years ago
parent
commit
92365eca0f
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      src/Fl_Widget.cxx

+ 3
- 2
src/Fl_Widget.cxx View File

@@ -282,11 +282,11 @@ Fl_Widget::label(const char *a) {

void
Fl_Widget::copy_label(const char *a) {
if (flags() & COPIED_LABEL) free((void *)(label_.value));

if ( ( !a || !label_.value ) || strcmp( a, label_.value ) )
redraw_label();

if (flags() & COPIED_LABEL) free((void *)(label_.value));

if (a) {
set_flag(COPIED_LABEL);
label_.value=strdup(a);
@@ -294,6 +294,7 @@ Fl_Widget::copy_label(const char *a) {
clear_flag(COPIED_LABEL);
label_.value=(char *)0;
}

}

/** Calls the widget callback.


Loading…
Cancel
Save