summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Woodward2005-04-26 03:58:36 +0000
committerJason Woodward2005-04-26 03:58:36 +0000
commit188e5f0d050c3830512f0914105a19ad9241f69e (patch)
treeca08399639176c2ee5055956aac0f59e6072de5e
parent37eae92e14d2b39b0ff5bef5c2e445ddacc96551 (diff)
downloadslapt-get-188e5f0d050c3830512f0914105a19ad9241f69e.tar.gz
changed location = strndup(tmp_location) to location = tmp_location since tmp_location wasn't being freed anyway
-rw-r--r--src/package.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/package.c b/src/package.c
index 47d9cce..f57a249 100644
--- a/src/package.c
+++ b/src/package.c
@@ -154,21 +154,21 @@ struct pkg_list *parse_packages_txt(FILE *pkg_list_fh){
tmp_location[1] = '\0';
strncat(tmp_location,&tmp_pkg->location[0] + strlen("./testing"), strlen(tmp_pkg->location) - strlen("./testing"));
free(tmp_pkg->location);
- tmp_pkg->location = strdup(tmp_location);
+ tmp_pkg->location = tmp_location;
}else if( strstr(tmp_pkg->location,"./extra/") != NULL ){
char *tmp_location = slapt_malloc(sizeof *tmp_location * (strlen(tmp_pkg->location) - strlen("./extra") + 2) );
tmp_location[0] = '.';
tmp_location[1] = '\0';
strncat(tmp_location,&tmp_pkg->location[0] + strlen("./extra"), strlen(tmp_pkg->location) - strlen("./extra"));
free(tmp_pkg->location);
- tmp_pkg->location = strdup(tmp_location);
+ tmp_pkg->location = tmp_location;
}else if( strstr(tmp_pkg->location,"./pasture/") != NULL ){
char *tmp_location = slapt_malloc(sizeof *tmp_location * (strlen(tmp_pkg->location) - strlen("./pasture") + 2) );
tmp_location[0] = '.';
tmp_location[1] = '\0';
strncat(tmp_location,&tmp_pkg->location[0] + strlen("./pasture"), strlen(tmp_pkg->location) - strlen("./pasture"));
free(tmp_pkg->location);
- tmp_pkg->location = strdup(tmp_location);
+ tmp_pkg->location = tmp_location;
}
}else{