summaryrefslogtreecommitdiff
path: root/include/xalloc.h
AgeCommit message (Collapse)AuthorFilesLines
2013-07-09include/xalloc: add warn_unused_result to allocation functionsKarel Zak1-3/+3
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-04-10lib/xalloc: add xstrndup()Karel Zak1-0/+15
Signed-off-by: Karel Zak <kzak@redhat.com>
2013-03-27lib/xalloc: fix mamory leak in xgethostname() [coverity scan]Karel Zak1-2/+4
Signed-off-by: Karel Zak <kzak@redhat.com>
2012-10-19include/xalloc: add xgethostname()Karel Zak1-0/+15
The new function allocates memory by xalloc() for hostname and fill in the buffer by gethostname(). Signed-off-by: Karel Zak <kzak@redhat.com>
2012-07-26include: define format to be constant in xasprintf()Sami Kerola1-1/+2
Add also format function attribute to add robustness. Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2012-03-18include: add asprintf wrapperSami Kerola1-0/+11
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
2011-09-30include,xalloc: fix whitespace to be consistentDave Reisner1-7/+7
We use spaces for the rest of this file, so the random tabs within xstrdup stand out. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-09-30include,xalloc: check for NULL before calling strdupDave Reisner1-2/+7
This fixes a segfault in mount (and possibly elsewhere) when invoked without a -t parameter. Broken in 7ef9fd7 when the common xalloc.h libs were introduced. Signed-off-by: Dave Reisner <dreisner@archlinux.org>
2011-02-21include: [xalloc.h]: mention strdup in the file descriptionPetr Uzel1-1/+1
Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
2011-02-14build-sys: provide alternatives for err, errx, warn and warnxFabian Groffen1-1/+0
Solaris lacks err, errx, warn and warnx. This also means the err.h header doesn't exist. Removed err.h include from all files, and included err.h from c.h instead if it exists, otherwise alternatives are provided. Signed-off-by: Fabian Groffen <grobian@gentoo.org>
2011-02-07include: [xalloc.h] include string.hMarek Polacek1-0/+1
xalloc.h needs string.h for declaration of strdup(). Otherwise we can get implicit declaration warning. This patch prevents it. Signed-off-by: Marek Polacek <mpolacek@redhat.com>
2011-02-07include: [c.h] add fallback for alloc_size attributesKarel Zak1-3/+5
Reported-by: Davidlohr Bueso <dave@gnu.org> Signed-off-by: Karel Zak <kzak@redhat.com>
2011-01-23lib: [xalloc] don't use hardcoded return codeKarel Zak1-4/+8
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-11-24lib: [xalloc] add xstrdup()Karel Zak1-0/+9
Signed-off-by: Karel Zak <kzak@redhat.com>
2010-10-21xalloc: general purpose memory allocation handling wrappersDavidlohr Bueso1-0/+46
[kzak@redhat.com: - use %zu for size_t] Signed-off-by: Davidlohr Bueso <dave@gnu.org> Signed-off-by: Karel Zak <kzak@redhat.com>