summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libalpm/be_local.c1
-rw-r--r--lib/libalpm/dload.c1
-rw-r--r--lib/libalpm/sync.c2
-rw-r--r--src/pacman/pacman.c5
-rw-r--r--src/pacman/util.c2
5 files changed, 8 insertions, 3 deletions
diff --git a/lib/libalpm/be_local.c b/lib/libalpm/be_local.c
index bbc0a8ac..f0e4a80f 100644
--- a/lib/libalpm/be_local.c
+++ b/lib/libalpm/be_local.c
@@ -943,6 +943,7 @@ int _alpm_local_db_remove(alpm_db_t *db, alpm_pkg_t *info)
dirp = opendir(pkgpath);
if(!dirp) {
+ free(pkgpath);
return -1;
}
/* go through the local DB entry, removing the files within, which we know
diff --git a/lib/libalpm/dload.c b/lib/libalpm/dload.c
index 6aaff1d2..3e1659e7 100644
--- a/lib/libalpm/dload.c
+++ b/lib/libalpm/dload.c
@@ -358,6 +358,7 @@ static FILE *create_tempfile(struct dload_payload *payload, const char *localpat
CLOSE(fd);
_alpm_log(payload->handle, ALPM_LOG_ERROR,
_("failed to create temporary file for download\n"));
+ free(randpath);
return NULL;
}
/* fp now points to our alpmtmp.XXXXXX */
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
index 841e5d6f..a4e58605 100644
--- a/lib/libalpm/sync.c
+++ b/lib/libalpm/sync.c
@@ -698,7 +698,7 @@ static int apply_deltas(alpm_handle_t *handle)
snprintf(from, len, "%s/%s", cachedir, d->from);
}
len = strlen(cachedir) + strlen(d->to) + 2;
- MALLOC(to, len, RET_ERR(handle, ALPM_ERR_MEMORY, 1));
+ MALLOC(to, len, free(from); RET_ERR(handle, ALPM_ERR_MEMORY, 1));
snprintf(to, len, "%s/%s", cachedir, d->to);
/* build the patch command */
diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c
index 1ca746d7..a25bbf84 100644
--- a/src/pacman/pacman.c
+++ b/src/pacman/pacman.c
@@ -812,10 +812,11 @@ int main(int argc, char *argv[])
/* we support reading targets from stdin if a cmdline parameter is '-' */
if(!isatty(fileno(stdin)) && alpm_list_find_str(pm_targets, "-")) {
size_t current_size = PATH_MAX;
- char *line = malloc(current_size);
+ char *vdata, *line = malloc(current_size);
/* remove the '-' from the list */
- pm_targets = alpm_list_remove_str(pm_targets, "-", NULL);
+ pm_targets = alpm_list_remove_str(pm_targets, "-", &vdata);
+ free(vdata);
i = 0;
while((line[i] = (char)fgetc(stdin)) != EOF) {
diff --git a/src/pacman/util.c b/src/pacman/util.c
index 78cdf264..4c471dd6 100644
--- a/src/pacman/util.c
+++ b/src/pacman/util.c
@@ -560,6 +560,8 @@ static size_t table_calc_widths(const alpm_list_t *header,
colwidths = malloc(totalcols * sizeof(size_t));
coldata = calloc(totalcols, sizeof(int));
if(!colwidths || !coldata) {
+ free(colwidths);
+ free(coldata);
return 0;
}
/* header determines column count and initial values of longest_strs */