fish: handle some out-of-memory conditions
authorJim Meyering <meyering@redhat.com>
Wed, 1 Jul 2009 14:09:33 +0000 (16:09 +0200)
committerJim Meyering <meyering@redhat.com>
Wed, 1 Jul 2009 16:42:19 +0000 (18:42 +0200)
* fish/destpaths.c (xalloc_oversized): Define.
(complete_dest_paths_generator): Use size_t as type for a few
variables, rather than int.
Don't deref NULL or undef on failed heap alloc.
Don't leak on failed realloc.
Detect theoretical overflow when count_strings returns a very
large number of strings.
Handle asprintf failure.
(APPEND_STRS_AND_FREE): Rewrite as do {...}while(0), so that each use
can/must be followed by a semicolon.  Better for auto-formatters.


No differences found