Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 225371 Details for
Bug 310071
Widec set_field_buffer fails with 'double free or corruption' error
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
this one uses two buffers and fails (in valgrind)
main2.c (text/x-csrc), 2.80 KB, created by
Victor Julien
on 2007-10-12 11:21:45 UTC
(
hide
)
Description:
this one uses two buffers and fails (in valgrind)
Filename:
MIME Type:
Creator:
Victor Julien
Created:
2007-10-12 11:21:45 UTC
Size:
2.80 KB
patch
obsolete
>#ifdef HAVE_CONFIG_H >#include <config.h> >#endif > >#include <stdio.h> >#include <stdlib.h> >#include <string.h> >#include <ncursesw/ncurses.h> >#include <ncursesw/panel.h> >#include <ncursesw/form.h> >#include <ncursesw/menu.h> > >int main() >{ > WINDOW *my_menu_win; > PANEL *my_panels[1]; > FIELD **fields, > *cur = NULL, > *prev = NULL; > FORM *form; > int n_fields, rows, cols, ch, quit = 0, i; > > /* Initialize curses */ > initscr(); > start_color(); > cbreak(); > noecho(); > keypad(stdscr, TRUE); > > init_pair(1, COLOR_WHITE, COLOR_BLUE); > init_pair(2, COLOR_GREEN, COLOR_WHITE); > init_pair(3, COLOR_WHITE, COLOR_GREEN); > > // Create the window to be associated with the menu */ > if(!(my_menu_win = newwin(15, 70, 30, 20))) > fprintf(stdout, "error"); > > my_panels[0] = new_panel(my_menu_win); > > (void)box(my_menu_win, 0, 0); > (void)wbkgd(my_menu_win, COLOR_PAIR(1)); > keypad(my_menu_win, TRUE); > > mvwprintw(my_menu_win, 1, 1, "Testing testing.\n"); > > n_fields = 2; > fields = (FIELD **)calloc(n_fields + 1, sizeof(FIELD *)); > > // create the fields > fields[0] = new_field(1, 5, 2, 1, 0, 2); > fields[1] = new_field(1, 5, 4, 1, 0, 2); > fields[n_fields] = NULL; > > for(i = 0; i < n_fields; i++) > { > // set field options > set_field_back(fields[i], COLOR_PAIR(3)); > field_opts_off(fields[i], O_AUTOSKIP); > > set_field_buffer(fields[i], 0, "tst0"); > set_field_buffer(fields[i], 1, "tst1"); > set_field_buffer(fields[i], 2, "tst2"); > } > > // Create the form and post it > form = new_form(fields); > // Calculate the area required for the form > scale_form(form, &rows, &cols); > // Set main window and sub window > set_form_win(form, my_menu_win); > set_form_sub(form, derwin(my_menu_win, rows, cols, 2, 2)); > > post_form(form); > > update_panels(); > doupdate(); > wrefresh(my_menu_win); >#if 0 > while(quit == 0) > { > ch = wgetch(my_menu_win); > > switch(ch) > { > case KEY_DOWN: > form_driver(form, REQ_NEXT_FIELD); > form_driver(form, REQ_BEG_LINE); > break; > case 10: // enter > form_driver(form, REQ_NEXT_FIELD); > form_driver(form, REQ_BEG_LINE); > break; > case KEY_UP: > form_driver(form, REQ_PREV_FIELD); > form_driver(form, REQ_BEG_LINE); > break; > case 27: > case KEY_F(10): > quit = 1; > break; > } > > } >#endif > char *buf0 = NULL, *buf1 = NULL, *buf2 = NULL; > char *bug0 = NULL, *bug1 = NULL, *bug2 = NULL; > > buf0 = field_buffer(fields[0], 0); > if (buf0) bug0 = strdup(buf0); > > buf1 = field_buffer(fields[0], 1); > if (buf1) bug1 = strdup(buf1); > > buf2 = field_buffer(fields[0], 2); > if (buf2) bug2 = strdup(buf2); > > unpost_form(form); > free_form(form); > > for(i = 0; i < n_fields; i++) > { > free_field(fields[i]); > } > free(fields); > > del_panel(my_panels[0]); > delwin(my_menu_win); > endwin(); > > printf("bug0 '%s'\n", bug0 ? bug0 : "null"); > printf("bug1 '%s'\n", bug1 ? bug1 : "null"); > printf("bug2 '%s'\n", bug2 ? bug2 : "null"); > > return(0); >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 310071
:
209101
|
209111
|
221091
|
221101
|
225361
| 225371 |
225441