diff options
author | Iliyan Malchev <malchev@google.com> | 2012-02-17 14:51:32 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-02-17 14:51:32 -0800 |
commit | 95221b51e4eba7b7367cb98033f3694d0ea9be74 (patch) | |
tree | 1082ec20491332164c2c02fdc03b8e4085a8c7be /libs/utils/BackupHelpers.cpp | |
parent | 18ce4566d3afe3a5050263ac60ea725692e858b0 (diff) | |
parent | 7e1d395686a23c8638f72af190f125cf690618a3 (diff) | |
download | frameworks_base-95221b51e4eba7b7367cb98033f3694d0ea9be74.zip frameworks_base-95221b51e4eba7b7367cb98033f3694d0ea9be74.tar.gz frameworks_base-95221b51e4eba7b7367cb98033f3694d0ea9be74.tar.bz2 |
Merge "libs/utils: replace malloc() + memset() to zero with calloc()"
Diffstat (limited to 'libs/utils/BackupHelpers.cpp')
-rw-r--r-- | libs/utils/BackupHelpers.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/libs/utils/BackupHelpers.cpp b/libs/utils/BackupHelpers.cpp index f77a891..214f6d7 100644 --- a/libs/utils/BackupHelpers.cpp +++ b/libs/utils/BackupHelpers.cpp @@ -546,7 +546,7 @@ int write_tarfile(const String8& packageName, const String8& domain, // read/write up to this much at a time. const size_t BUFSIZE = 32 * 1024; - char* buf = new char[BUFSIZE]; + char* buf = (char *)calloc(1,BUFSIZE); char* paxHeader = buf + 512; // use a different chunk of it as separate scratch char* paxData = buf + 1024; @@ -556,9 +556,6 @@ int write_tarfile(const String8& packageName, const String8& domain, goto cleanup; } - // Good to go -- first construct the standard tar header at the start of the buffer - memset(buf, 0, BUFSIZE); - // Magic fields for the ustar file format strcat(buf + 257, "ustar"); strcat(buf + 263, "00"); |