From: Andre Noll Date: Sat, 1 Nov 2008 21:55:38 +0000 (+0100) Subject: Make free_format_info() cope with NULL pointers. X-Git-Tag: v0.0.4~17 X-Git-Url: http://git.tuebingen.mpg.de/?p=adu.git;a=commitdiff_plain;h=22dc8e380d27b93a70d49c8a49f139ccf59d6f60 Make free_format_info() cope with NULL pointers. Be liberal with what you take, just as the usual free() function. --- diff --git a/format.c b/format.c index 6b7a2f6..f6b1f48 100644 --- a/format.c +++ b/format.c @@ -262,11 +262,17 @@ err: return ret; } +/** + * It's OK to pass a \p NULL pointer to this function. + */ void free_format_info(struct format_info *info) { int i; struct format_item *item; + if (!info) + return; + for (i = 0; (item = info->items[i]); i++) { if (!item->atom_ptr) free(item->af.cs.string);