projects
/
platform
/
upstream
/
rpm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
eabf5f3
)
Avoid alloca() in rpmteColorDS()
author
Panu Matilainen
<pmatilai@redhat.com>
Fri, 25 Apr 2008 10:28:51 +0000
(13:28 +0300)
committer
Panu Matilainen
<pmatilai@redhat.com>
Fri, 25 Apr 2008 12:28:38 +0000
(15:28 +0300)
lib/rpmte.c
patch
|
blob
|
history
diff --git
a/lib/rpmte.c
b/lib/rpmte.c
index
604be1c
..
edb28ea
100644
(file)
--- a/
lib/rpmte.c
+++ b/
lib/rpmte.c
@@
-523,10
+523,9
@@
void rpmteColorDS(rpmte te, rpmTag tag)
break;
}
- nb = Count * sizeof(*colors);
- colors = memset(alloca(nb), 0, nb);
+ colors = xcalloc(Count, sizeof(*colors));
nb = Count * sizeof(*refs);
- refs = memset(
alloca
(nb), -1, nb);
+ refs = memset(
xmalloc
(nb), -1, nb);
/* Calculate dependency color and reference count. */
fi = rpmfiInit(fi, 0);
@@
-559,6
+558,8
@@
assert (ix < Count);
val++;
(void) rpmdsSetRefs(ds, val);
}
+ free(colors);
+ free(refs);
}
int rpmtsiOc(rpmtsi tsi)