Skip to content

Commit

Permalink
Use xstrdup instead of strdup in builtin-{tar,zip}-tree.c
Browse files Browse the repository at this point in the history
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
(cherry picked from 5d2aea4cb383a43e40d47ab69d8ad7a495df6ea2 commit)
  • Loading branch information
Rene Scharfe authored and Junio C Hamano committed Sep 10, 2006
1 parent 37f9443 commit 326711c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion builtin-tar-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ int write_tar_archive(struct archiver_args *args)
write_global_extended_header(args->commit_sha1);

if (args->base && plen > 0 && args->base[plen - 1] == '/') {
char *base = strdup(args->base);
char *base = xstrdup(args->base);
int baselen = strlen(base);

while (baselen > 0 && base[baselen - 1] == '/')
Expand Down
2 changes: 1 addition & 1 deletion builtin-zip-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ int write_zip_archive(struct archiver_args *args)
zip_dir_size = ZIP_DIRECTORY_MIN_SIZE;

if (args->base && plen > 0 && args->base[plen - 1] == '/') {
char *base = strdup(args->base);
char *base = xstrdup(args->base);
int baselen = strlen(base);

while (baselen > 0 && base[baselen - 1] == '/')
Expand Down

0 comments on commit 326711c

Please sign in to comment.