summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2008-01-11 00:01:58 -0600
committerDan McGee <dan@archlinux.org>2008-01-11 00:01:58 -0600
commitccc1c731529de16f6fa4064fd992a8f63d7cfc26 (patch)
treedc5b96634cb255cfcbee1e57079d32491db9fc5e /src
parent0a65de10b1cd8bd450e47e735cb909eec13822d0 (diff)
downloadpacman-ccc1c731529de16f6fa4064fd992a8f63d7cfc26.tar.xz
Use dynamic string allocation in package structures
This also affects all structures with static strings, such as depmiss, conflict, etc. This should help a lot with memory usage, and hopefully make things a bit more "idiot proof". Currently our pactest pass/fail rate is identical before and after this patch. This is not to say it is a perfect patch- I have yet to pull valgrind out. However, this should be quite safe to use in all situations from here on out, and we can start plugging the memleaks. Original-work-by: Aaron Griffin <aaronmgriffin@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src')
-rw-r--r--src/pacman/util.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/pacman/util.c b/src/pacman/util.c
index 1806ee52..a3ac66a7 100644
--- a/src/pacman/util.c
+++ b/src/pacman/util.c
@@ -194,6 +194,10 @@ void indentprint(const char *str, int indent)
const char *p = str;
int cidx = indent;
+ if(!p) {
+ return;
+ }
+
while(*p) {
if(*p == ' ') {
const char *next = NULL;