Commit 69c2b407 authored by Christoffer Ackelman's avatar Christoffer Ackelman Committed by Esteban Blanc

QT: Fix QString -> char* memory leak in Hist window.

parent 6201b2ae
......@@ -375,15 +375,24 @@ void HistQtWidget::ok_btn()
hist->eventPrio_D = hist->prioD_toggle_w->isChecked();
hist->minTime_str = (char*)malloc(hist->start_time_entry_w->text().length() + 1);
strcpy(hist->minTime_str, qPrintableLatin1(hist->start_time_entry_w->text()));
hist->maxTime_str = (char*)malloc(hist->stop_time_entry_w->text().length() + 1);
strcpy(hist->maxTime_str, qPrintableLatin1(hist->stop_time_entry_w->text()));
hist->eventText_str = (char*)malloc(hist->event_text_entry_w->text().length() + 1);
strcpy(hist->eventText_str, qPrintableLatin1(hist->event_text_entry_w->text()));
hist->eventName_str = (char*)malloc(hist->event_name_entry_w->text().length() + 1);
strcpy(hist->minTime_str, qPrintableLatin1(hist->start_time_entry_w->text()));
strcpy(hist->maxTime_str, qPrintableLatin1(hist->stop_time_entry_w->text()));
strcpy(hist->eventText_str, qPrintableLatin1(hist->event_text_entry_w->text()));
strcpy(hist->eventName_str, qPrintableLatin1(hist->event_name_entry_w->text()));
hist->get_hist_list();
free(hist->minTime_str);
free(hist->maxTime_str);
free(hist->eventText_str);
free(hist->eventName_str);
hist->minTime_str = NULL;
hist->maxTime_str = NULL;
hist->eventText_str = NULL;
hist->eventName_str = NULL;
}
void HistQtWidget::activate_print()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment