diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2016-02-10 10:14:50 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2016-02-10 11:41:10 -0800 |
commit | 25ec995c064d4e658fe3f9af084f120ae21a021a (patch) | |
tree | 796426490202643af30b6108c8968d311e22f7a9 /lisp/emacs-lisp/float-sup.el | |
parent | 02d925e9e55089fabfe03e5a911c391b9322978f (diff) | |
download | emacs-25ec995c064d4e658fe3f9af084f120ae21a021a.tar.gz emacs-25ec995c064d4e658fe3f9af084f120ae21a021a.tar.bz2 emacs-25ec995c064d4e658fe3f9af084f120ae21a021a.zip |
Memory-management cleanup in make-docfile
I compiled it with -fsanitize=address and fixed the leaks it detected.
Also, I changed it to prefer signed to unsigned integer types,
and to check for integer overflow.
* lib-src/make-docfile.c:
Include <stddef.h>, <stdint.h>, <intprops.h>, <min-max.h>.
(memory_exhausted): New function.
(xmalloc, xrealloc): Use it.
(xmalloc, xrealloc, scan_file, struct rcsoc_state, write_c_args)
(uncompiled, scan_lisp_file):
Prefer signed integer types to unsigned.
(xstrdup): Remove. All uses removed.
(num_globals, num_globals_allocated, write_globals, scan_c_stream):
Use ptrdiff_t, not int, for indexes that in theory could exceed INT_MAX.
(add_global): Use const to pacify --enable-gcc-warnings.
Make a copy here, rather than relying on strdup calls later.
(add_global, write_globals, scan_c_stream):
Avoid integer overflow when calculating sizes.
(write_globals, scan_c_stream, scan_lisp_file): Avoid memory leak.
(scan_c_stream): Check for add_global failure.
Diffstat (limited to 'lisp/emacs-lisp/float-sup.el')
0 files changed, 0 insertions, 0 deletions