Skip to contentSkip to conversation

prlimit: use xalloc libs

PATCH Applied Davidlohr Bueso 2 participants 2 messages Dec 20, 2011 Util-Linux package

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 prlimit: use xalloc libs

From: Davidlohr Bueso <[email protected]>

---
 sys-utils/prlimit.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
sys-utils/prlimit.c +1 -1
index c785909..8235eb1 100644
@@ -452,7 +452,7 @@ static int parse_prlim(struct rlimit *lim, char *ops, size_t id)
 
 static int add_prlim(char *ops, struct list_head *lims, size_t id)
 {
-	struct prlimit *lim = calloc(1, sizeof(*lim));
+	struct prlimit *lim = xcalloc(1, sizeof(*lim));
 
 	INIT_LIST_HEAD(&lim->lims);
 	lim->desc = &prlimit_desc[id];
Signature · 1 line
1.7.4.1
maintainer Applied
#1 lore raw

sys-utils/prlimit.c static int parse_prlim(struct rlimit *lim, char *ops, size_t id) · line 455

Quoted 1 line · Davidlohr Bueso
sys-utils/prlimit.c +1 -0
+	struct prlimit *lim = xcalloc(1, sizeof(*lim));

Applied, thanks.

It would be nice to have a script tools/checkxalloc.sh to check if all code where we include "xalloc.h" use stuff from this file only. Volunteers? :-)

Karel

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com