diff options
| author | Joakim Verona | 2011-10-14 11:00:50 +0200 |
|---|---|---|
| committer | Joakim Verona | 2011-10-14 11:00:50 +0200 |
| commit | dab7e06ab78b5aa2b747ded874bbef8b6667a28d (patch) | |
| tree | 60e8a4d369258032e70dfbc5533027367e69997f /lwlib | |
| parent | 3d9b00348ff3d3c70e1cad0b4804170a6a24779d (diff) | |
| parent | 466a320edc8304632373066a61ee9f5903aa82a1 (diff) | |
| download | emacs-dab7e06ab78b5aa2b747ded874bbef8b6667a28d.tar.gz emacs-dab7e06ab78b5aa2b747ded874bbef8b6667a28d.zip | |
upstream
Diffstat (limited to 'lwlib')
| -rw-r--r-- | lwlib/ChangeLog | 10 | ||||
| -rw-r--r-- | lwlib/lwlib-Xaw.c | 4 | ||||
| -rw-r--r-- | lwlib/lwlib-Xm.c | 12 | ||||
| -rw-r--r-- | lwlib/lwlib-utils.c | 2 | ||||
| -rw-r--r-- | lwlib/lwlib.c | 16 | ||||
| -rw-r--r-- | lwlib/xlwmenu.c | 2 |
6 files changed, 28 insertions, 18 deletions
diff --git a/lwlib/ChangeLog b/lwlib/ChangeLog index 7e332a9fd5d..3b494865f0c 100644 --- a/lwlib/ChangeLog +++ b/lwlib/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 2 | |||
| 3 | * lwlib-Xaw.c (openFont, xaw_destroy_instance): Replace free with | ||
| 4 | xfree to avoid crash when xmalloc overrun checking is enabled. | ||
| 5 | * lwlib-Xm.c (free_destroyed_instance, xm_update_one_value): Ditto. | ||
| 6 | * lwlib-utils.c (XtApplyToWidgets): Ditto. | ||
| 7 | * lwlib.c (safe_free_str, free_widget_value, free_widget_value_tree) | ||
| 8 | (free_widget_info, free_widget_instance, name_to_widget): Ditto. | ||
| 9 | * xlwmenu.c (openXftFont): Ditto. | ||
| 10 | |||
| 1 | 2011-06-27 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> | 11 | 2011-06-27 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> |
| 2 | 12 | ||
| 3 | * Makefile.in (ALL_CFLAGS): Add -I../lib for generated header files | 13 | * Makefile.in (ALL_CFLAGS): Add -I../lib for generated header files |
diff --git a/lwlib/lwlib-Xaw.c b/lwlib/lwlib-Xaw.c index 9c9a007bc15..0eea0aba7b6 100644 --- a/lwlib/lwlib-Xaw.c +++ b/lwlib/lwlib-Xaw.c | |||
| @@ -136,7 +136,7 @@ openFont (Widget widget, char *name) | |||
| 136 | } | 136 | } |
| 137 | 137 | ||
| 138 | fn = XftFontOpenName (XtDisplay (widget), screen, fname); | 138 | fn = XftFontOpenName (XtDisplay (widget), screen, fname); |
| 139 | if (fname != name) free (fname); | 139 | if (fname != name) xfree (fname); |
| 140 | 140 | ||
| 141 | return fn; | 141 | return fn; |
| 142 | } | 142 | } |
| @@ -384,7 +384,7 @@ xaw_destroy_instance (widget_instance *instance) | |||
| 384 | if (instance->xft_data[0].xft_font) | 384 | if (instance->xft_data[0].xft_font) |
| 385 | XftFontClose (XtDisplay (instance->widget), | 385 | XftFontClose (XtDisplay (instance->widget), |
| 386 | instance->xft_data[0].xft_font); | 386 | instance->xft_data[0].xft_font); |
| 387 | free (instance->xft_data); | 387 | xfree (instance->xft_data); |
| 388 | } | 388 | } |
| 389 | #endif | 389 | #endif |
| 390 | if (XtIsSubclass (instance->widget, dialogWidgetClass)) | 390 | if (XtIsSubclass (instance->widget, dialogWidgetClass)) |
diff --git a/lwlib/lwlib-Xm.c b/lwlib/lwlib-Xm.c index 2b7677a02f5..058e2e779c7 100644 --- a/lwlib/lwlib-Xm.c +++ b/lwlib/lwlib-Xm.c | |||
| @@ -186,9 +186,9 @@ make_destroyed_instance (char* name, | |||
| 186 | static void | 186 | static void |
| 187 | free_destroyed_instance (destroyed_instance* instance) | 187 | free_destroyed_instance (destroyed_instance* instance) |
| 188 | { | 188 | { |
| 189 | free (instance->name); | 189 | xfree (instance->name); |
| 190 | free (instance->type); | 190 | xfree (instance->type); |
| 191 | free (instance); | 191 | xfree (instance); |
| 192 | } | 192 | } |
| 193 | 193 | ||
| 194 | /* motif utility functions */ | 194 | /* motif utility functions */ |
| @@ -928,13 +928,13 @@ xm_update_one_value (widget_instance* instance, | |||
| 928 | } | 928 | } |
| 929 | else if (class == xmTextWidgetClass) | 929 | else if (class == xmTextWidgetClass) |
| 930 | { | 930 | { |
| 931 | free (val->value); | 931 | xfree (val->value); |
| 932 | val->value = XmTextGetString (widget); | 932 | val->value = XmTextGetString (widget); |
| 933 | val->edited = True; | 933 | val->edited = True; |
| 934 | } | 934 | } |
| 935 | else if (class == xmTextFieldWidgetClass) | 935 | else if (class == xmTextFieldWidgetClass) |
| 936 | { | 936 | { |
| 937 | free (val->value); | 937 | xfree (val->value); |
| 938 | val->value = XmTextFieldGetString (widget); | 938 | val->value = XmTextFieldGetString (widget); |
| 939 | val->edited = True; | 939 | val->edited = True; |
| 940 | } | 940 | } |
| @@ -959,7 +959,7 @@ xm_update_one_value (widget_instance* instance, | |||
| 959 | XtVaGetValues (toggle, XmNset, &set, NULL); | 959 | XtVaGetValues (toggle, XmNset, &set, NULL); |
| 960 | if (set) | 960 | if (set) |
| 961 | { | 961 | { |
| 962 | free (val->value); | 962 | xfree (val->value); |
| 963 | val->value = safe_strdup (XtName (toggle)); | 963 | val->value = safe_strdup (XtName (toggle)); |
| 964 | } | 964 | } |
| 965 | } | 965 | } |
diff --git a/lwlib/lwlib-utils.c b/lwlib/lwlib-utils.c index 7a0dd1b264a..fe236a210f3 100644 --- a/lwlib/lwlib-utils.c +++ b/lwlib/lwlib-utils.c | |||
| @@ -80,7 +80,7 @@ XtApplyToWidgets (Widget w, XtApplyToWidgetsProc proc, XtPointer arg) | |||
| 80 | XtApplyToWidgets (kids [i], proc, arg); | 80 | XtApplyToWidgets (kids [i], proc, arg); |
| 81 | proc (kids [i], arg); | 81 | proc (kids [i], arg); |
| 82 | } | 82 | } |
| 83 | free (kids); | 83 | xfree (kids); |
| 84 | } | 84 | } |
| 85 | } | 85 | } |
| 86 | 86 | ||
diff --git a/lwlib/lwlib.c b/lwlib/lwlib.c index 9d8ec3330d3..7e3538aec04 100644 --- a/lwlib/lwlib.c +++ b/lwlib/lwlib.c | |||
| @@ -138,7 +138,7 @@ my_strcasecmp (const char *s1, const char *s2) | |||
| 138 | static void | 138 | static void |
| 139 | safe_free_str (char *s) | 139 | safe_free_str (char *s) |
| 140 | { | 140 | { |
| 141 | free (s); | 141 | xfree (s); |
| 142 | } | 142 | } |
| 143 | 143 | ||
| 144 | static widget_value *widget_value_free_list = 0; | 144 | static widget_value *widget_value_free_list = 0; |
| @@ -176,7 +176,7 @@ free_widget_value (widget_value *wv) | |||
| 176 | { | 176 | { |
| 177 | /* When the number of already allocated cells is too big, | 177 | /* When the number of already allocated cells is too big, |
| 178 | We free it. */ | 178 | We free it. */ |
| 179 | free (wv); | 179 | xfree (wv); |
| 180 | malloc_cpt--; | 180 | malloc_cpt--; |
| 181 | } | 181 | } |
| 182 | else | 182 | else |
| @@ -192,9 +192,9 @@ free_widget_value_tree (widget_value *wv) | |||
| 192 | if (!wv) | 192 | if (!wv) |
| 193 | return; | 193 | return; |
| 194 | 194 | ||
| 195 | free (wv->name); | 195 | xfree (wv->name); |
| 196 | free (wv->value); | 196 | xfree (wv->value); |
| 197 | free (wv->key); | 197 | xfree (wv->key); |
| 198 | 198 | ||
| 199 | wv->name = wv->value = wv->key = (char *) 0xDEADBEEF; | 199 | wv->name = wv->value = wv->key = (char *) 0xDEADBEEF; |
| 200 | 200 | ||
| @@ -281,7 +281,7 @@ free_widget_info (widget_info *info) | |||
| 281 | safe_free_str (info->name); | 281 | safe_free_str (info->name); |
| 282 | free_widget_value_tree (info->val); | 282 | free_widget_value_tree (info->val); |
| 283 | memset ((void*)info, 0xDEADBEEF, sizeof (widget_info)); | 283 | memset ((void*)info, 0xDEADBEEF, sizeof (widget_info)); |
| 284 | free (info); | 284 | xfree (info); |
| 285 | } | 285 | } |
| 286 | 286 | ||
| 287 | static void | 287 | static void |
| @@ -317,7 +317,7 @@ static void | |||
| 317 | free_widget_instance (widget_instance *instance) | 317 | free_widget_instance (widget_instance *instance) |
| 318 | { | 318 | { |
| 319 | memset ((void*)instance, 0xDEADBEEF, sizeof (widget_instance)); | 319 | memset ((void*)instance, 0xDEADBEEF, sizeof (widget_instance)); |
| 320 | free (instance); | 320 | xfree (instance); |
| 321 | } | 321 | } |
| 322 | 322 | ||
| 323 | static widget_info * | 323 | static widget_info * |
| @@ -602,7 +602,7 @@ name_to_widget (widget_instance *instance, const char *name) | |||
| 602 | 602 | ||
| 603 | widget = XtNameToWidget (instance->widget, real_name); | 603 | widget = XtNameToWidget (instance->widget, real_name); |
| 604 | 604 | ||
| 605 | free (real_name); | 605 | xfree (real_name); |
| 606 | } | 606 | } |
| 607 | return widget; | 607 | return widget; |
| 608 | } | 608 | } |
diff --git a/lwlib/xlwmenu.c b/lwlib/xlwmenu.c index e9ec604ae7f..5ed33d5be05 100644 --- a/lwlib/xlwmenu.c +++ b/lwlib/xlwmenu.c | |||
| @@ -1891,7 +1891,7 @@ openXftFont (XlwMenuWidget mw) | |||
| 1891 | } | 1891 | } |
| 1892 | } | 1892 | } |
| 1893 | 1893 | ||
| 1894 | if (fname != mw->menu.fontName) free (fname); | 1894 | if (fname != mw->menu.fontName) xfree (fname); |
| 1895 | 1895 | ||
| 1896 | return mw->menu.xft_font != 0; | 1896 | return mw->menu.xft_font != 0; |
| 1897 | } | 1897 | } |