From f71c4e16e913f660977526f0ef8d2acdf458d7c9 Mon Sep 17 00:00:00 2001 From: Lasse Collin Date: Tue, 18 Jan 2011 21:23:50 +0200 Subject: Add alloc_size and malloc attributes to a few functions. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks to Cristian Rodríguez for the original patch. --- src/xz/util.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/xz') diff --git a/src/xz/util.h b/src/xz/util.h index fea8cc66..4b2d3e2f 100644 --- a/src/xz/util.h +++ b/src/xz/util.h @@ -19,11 +19,12 @@ /// \brief Safe realloc() that never returns NULL -extern void *xrealloc(void *ptr, size_t size); +extern void *xrealloc(void *ptr, size_t size) + lzma_attribute((malloc)) lzma_attr_alloc_size(2); /// \brief Safe strdup() that never returns NULL -extern char *xstrdup(const char *src); +extern char *xstrdup(const char *src) lzma_attribute((malloc)); /// \brief Fancy version of strtoull() -- cgit v1.2.3