Merge lp:~luszczyk/sakura/reviews into lp:~dabisu/sakura/sakura

Proposed by Michał Łuszczyk
Status: Merged
Approved by: David Gómez
Approved revision: 331
Merge reported by: David Gómez
Merged at revision: not available
Proposed branch: lp:~luszczyk/sakura/reviews
Merge into: lp:~dabisu/sakura/sakura
Diff against target: 31 lines (+7/-3)
1 file modified
src/sakura.c (+7/-3)
To merge this branch: bzr merge lp:~luszczyk/sakura/reviews
Reviewer Review Type Date Requested Status
David Gómez Approve
Review via email: mp+38554@code.launchpad.net

Description of the change

Fixed an error, that causes SEGFAULT when calling sakura_error with few arguments, e.g. when no browser is found in sakura_open_url.

To post a comment you must log in.
lp:~luszczyk/sakura/reviews updated
331. By Michał Łuszczyk

Freeing allocated memory

Revision history for this message
David Gómez (dabisu) wrote :

Thanks! Sorry for the delay

Revision history for this message
David Gómez (dabisu) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/sakura.c'
--- src/sakura.c 2010-10-06 13:45:12 +0000
+++ src/sakura.c 2010-10-19 19:14:02 +0000
@@ -229,6 +229,7 @@
229#define DEFAULT_PASTE_KEY GDK_V229#define DEFAULT_PASTE_KEY GDK_V
230#define DEFAULT_SCROLLBAR_KEY GDK_S230#define DEFAULT_SCROLLBAR_KEY GDK_S
231#define DEFAULT_FULLSCREEN_KEY GDK_F11231#define DEFAULT_FULLSCREEN_KEY GDK_F11
232#define ERROR_BUFFER_LENGTH 256
232const char cfg_group[] = "sakura";233const char cfg_group[] = "sakura";
233234
234static GQuark term_data_id = 0;235static GQuark term_data_id = 0;
@@ -2403,15 +2404,18 @@
2403{2404{
2404 GtkWidget *dialog;2405 GtkWidget *dialog;
2405 va_list args;2406 va_list args;
2407 char* buff;
24062408
2407 va_start(args, format);2409 va_start(args, format);
2410 buff = malloc(sizeof(char)*ERROR_BUFFER_LENGTH);
2411 vsnprintf(buff, sizeof(char)*ERROR_BUFFER_LENGTH, format, args);
2412 va_end(args);
24082413
2409 dialog = gtk_message_dialog_new(GTK_WINDOW(sakura.main_window), GTK_DIALOG_DESTROY_WITH_PARENT,2414 dialog = gtk_message_dialog_new(GTK_WINDOW(sakura.main_window), GTK_DIALOG_DESTROY_WITH_PARENT,
2410 GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, format, args);2415 GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "%s", buff);
2411 gtk_dialog_run (GTK_DIALOG (dialog));2416 gtk_dialog_run (GTK_DIALOG (dialog));
2412
2413 va_end(args);
2414 gtk_widget_destroy (dialog);2417 gtk_widget_destroy (dialog);
2418 free(buff);
2415}2419}
24162420
24172421

Subscribers

People subscribed via source and target branches