X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=format.c;h=f6b1f48d102d9762696de1345fd61cdce9c83c28;hb=22dc8e380d27b93a70d49c8a49f139ccf59d6f60;hp=48aa37111c2986d6262686723dd766c9f0ed45ef;hpb=bd06800e612996d0c4b4c2ec52646a842d301452;p=adu.git diff --git a/format.c b/format.c index 48aa371..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); @@ -423,6 +429,7 @@ char *format_items(struct format_info *info, union atom_value *values) fi->width, &af->nf, type); } buf = adu_strcat(buf, val); + free(val); } return buf; }