diff options
author | Nick Kew <niq@apache.org> | 2007-07-20 03:26:55 +0200 |
---|---|---|
committer | Nick Kew <niq@apache.org> | 2007-07-20 03:26:55 +0200 |
commit | e5061abc935fd70def787ec1aff598e94224b54b (patch) | |
tree | 6d311125078b05777d5cfed036877839d443c784 /modules/dav/fs/lock.c | |
parent | Copy the enum into an integer before sending off to the LDAP SDK, to avoid (diff) | |
download | apache2-e5061abc935fd70def787ec1aff598e94224b54b.tar.xz apache2-e5061abc935fd70def787ec1aff598e94224b54b.zip |
Multiple trivial fixes from Christophe JAILLET
PR 38699, 39518, 42005, 42006, 42007, 42008, 42009
The patches are all his, and are sufficiently trivial to review
at a glance.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@557837 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/dav/fs/lock.c')
-rw-r--r-- | modules/dav/fs/lock.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/modules/dav/fs/lock.c b/modules/dav/fs/lock.c index 61dd8553a9..32220a79ba 100644 --- a/modules/dav/fs/lock.c +++ b/modules/dav/fs/lock.c @@ -600,8 +600,7 @@ static dav_error * dav_fs_load_lock_record(dav_lockdb *lockdb, apr_datum_t key, dp = apr_pcalloc(p, sizeof(*dp)); memcpy(dp, val.dptr + offset, sizeof(dp->f)); offset += sizeof(dp->f); - dp->locktoken = apr_palloc(p, sizeof(*dp->locktoken)); - memcpy(dp->locktoken, val.dptr + offset, sizeof(*dp->locktoken)); + dp->locktoken = apr_pmemdup(p, val.dptr + offset, sizeof(*dp->locktoken)); offset += sizeof(*dp->locktoken); if (*(val.dptr + offset) == '\0') { ++offset; @@ -648,15 +647,13 @@ static dav_error * dav_fs_load_lock_record(dav_lockdb *lockdb, apr_datum_t key, /* Create and fill a dav_lock_indirect structure */ ip = apr_pcalloc(p, sizeof(*ip)); - ip->locktoken = apr_palloc(p, sizeof(*ip->locktoken)); - memcpy(ip->locktoken, val.dptr + offset, sizeof(*ip->locktoken)); + ip->locktoken = apr_pmemdup(p, val.dptr + offset, sizeof(*ip->locktoken)); offset += sizeof(*ip->locktoken); memcpy(&ip->timeout, val.dptr + offset, sizeof(ip->timeout)); offset += sizeof(ip->timeout); memcpy(&ip->key.dsize, val.dptr + offset, sizeof(ip->key.dsize)); /* length of datum */ offset += sizeof(ip->key.dsize); - ip->key.dptr = apr_palloc(p, ip->key.dsize); - memcpy(ip->key.dptr, val.dptr + offset, ip->key.dsize); + ip->key.dptr = apr_pmemdup(p, val.dptr + offset, ip->key.dsize); offset += ip->key.dsize; if (!dav_fs_lock_expired(ip->timeout)) { |