summaryrefslogtreecommitdiff
path: root/build/parseScript.c
diff options
context:
space:
mode:
authorjbj <devnull@localhost>1999-09-21 03:22:53 +0000
committerjbj <devnull@localhost>1999-09-21 03:22:53 +0000
commit20d78e939aa218e85ef19013769494851d863f13 (patch)
tree9fddb9815dafcdd8e7eb20bb4ec9fe3a80270b39 /build/parseScript.c
parent78ce864c5eee9b2d4fc3a3a4a201818f4e500d50 (diff)
downloadlibrpm-tizen-20d78e939aa218e85ef19013769494851d863f13.tar.gz
librpm-tizen-20d78e939aa218e85ef19013769494851d863f13.tar.bz2
librpm-tizen-20d78e939aa218e85ef19013769494851d863f13.zip
fix: command line install had header memory leak.
check for NULL on all memory allocations. free rpmrc mallocs on exit. permit run time leak detection. CVS patchset: 3311 CVS date: 1999/09/21 03:22:53
Diffstat (limited to 'build/parseScript.c')
-rw-r--r--build/parseScript.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/build/parseScript.c b/build/parseScript.c
index cab12343b..8ce55a057 100644
--- a/build/parseScript.c
+++ b/build/parseScript.c
@@ -18,11 +18,11 @@ static int addTriggerIndex(Package pkg, char *file, char *script, char *prog)
index = last->index + 1;
}
- new = malloc(sizeof(*new));
+ new = xmalloc(sizeof(*new));
- new->fileName = (file) ? strdup(file) : NULL;
- new->script = (*script) ? strdup(script) : NULL;
- new->prog = strdup(prog);
+ new->fileName = (file) ? xstrdup(file) : NULL;
+ new->script = (*script) ? xstrdup(script) : NULL;
+ new->prog = xstrdup(prog);
new->index = index;
new->next = NULL;
@@ -259,19 +259,19 @@ int parseScript(Spec spec, int parsePart)
if (file) {
switch (parsePart) {
case PART_PRE:
- pkg->preInFile = strdup(file);
+ pkg->preInFile = xstrdup(file);
break;
case PART_POST:
- pkg->postInFile = strdup(file);
+ pkg->postInFile = xstrdup(file);
break;
case PART_PREUN:
- pkg->preUnFile = strdup(file);
+ pkg->preUnFile = xstrdup(file);
break;
case PART_POSTUN:
- pkg->postUnFile = strdup(file);
+ pkg->postUnFile = xstrdup(file);
break;
case PART_VERIFYSCRIPT:
- pkg->verifyFile = strdup(file);
+ pkg->verifyFile = xstrdup(file);
break;
}
}