summaryrefslogtreecommitdiff
path: root/build.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.c
parent78ce864c5eee9b2d4fc3a3a4a201818f4e500d50 (diff)
downloadrpm-20d78e939aa218e85ef19013769494851d863f13.tar.gz
rpm-20d78e939aa218e85ef19013769494851d863f13.tar.bz2
rpm-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.c')
-rw-r--r--build.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/build.c b/build.c
index 833678a9d..e3fe075b6 100644
--- a/build.c
+++ b/build.c
@@ -1,7 +1,6 @@
#include "system.h"
-#include "build/rpmbuild.h"
-#include "popt/popt.h"
+#include "rpmbuild.h"
#include "build.h"
#include "install.h"
@@ -312,7 +311,7 @@ static void buildArgCallback(poptContext con, enum poptCallbackReason reason,
fprintf(stderr, _("buildroot already specified"));
exit(EXIT_FAILURE);
}
- data->buildRootOverride = strdup(arg);
+ data->buildRootOverride = xstrdup(arg);
break;
case POPT_BUILDARCH:
fprintf(stderr, _("--buildarch has been obsoleted. Use the --target option instead.\n"));
@@ -325,10 +324,10 @@ static void buildArgCallback(poptContext con, enum poptCallbackReason reason,
case POPT_TARGETPLATFORM:
if (data->targets) {
int len = strlen(data->targets) + strlen(arg) + 2;
- data->targets = realloc(data->targets, len);
+ data->targets = xrealloc(data->targets, len);
strcat(data->targets, ",");
} else {
- data->targets = malloc(strlen(arg) + 1);
+ data->targets = xmalloc(strlen(arg) + 1);
data->targets[0] = '\0';
}
strcat(data->targets, arg);