diff options
| author | Paul Eggert | 2014-02-28 13:45:34 -0800 |
|---|---|---|
| committer | Paul Eggert | 2014-02-28 13:45:34 -0800 |
| commit | 8268febfe0c336ff47a61d0d416fd4bebf61a993 (patch) | |
| tree | 4a1590e6aff922e69646cc35347192ea507b1c7a /src/lisp.h | |
| parent | b70257b07ea6053bce27b20ad0bda50f547bd393 (diff) | |
| download | emacs-8268febfe0c336ff47a61d0d416fd4bebf61a993.tar.gz emacs-8268febfe0c336ff47a61d0d416fd4bebf61a993.zip | |
Fix a few crashes and leaks when cloning C strings.
* alloc.c, lisp.h (dupstring): New function.
* gtkutil.c (xg_get_font):
* term.c (tty_default_color_capabilities):
* xsettings.c (store_monospaced_changed)
(store_font_name_changed, parse_settings)
(read_and_apply_settings, init_gsettings, init_gconf): Use it.
This avoids some unlikely crashes due to accessing freed storage,
and avoids some minor memory leaks in the more-typical case.
Diffstat (limited to 'src/lisp.h')
| -rw-r--r-- | src/lisp.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/lisp.h b/src/lisp.h index a7e80a41c28..2f9a30fdfe9 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -4398,6 +4398,7 @@ extern void *xpalloc (void *, ptrdiff_t *, ptrdiff_t, ptrdiff_t, ptrdiff_t); | |||
| 4398 | 4398 | ||
| 4399 | extern char *xstrdup (const char *); | 4399 | extern char *xstrdup (const char *); |
| 4400 | extern char *xlispstrdup (Lisp_Object); | 4400 | extern char *xlispstrdup (Lisp_Object); |
| 4401 | extern void dupstring (char **, char const *); | ||
| 4401 | extern void xputenv (const char *); | 4402 | extern void xputenv (const char *); |
| 4402 | 4403 | ||
| 4403 | extern char *egetenv (const char *); | 4404 | extern char *egetenv (const char *); |