git.samba.org
/
samba.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
s4:heimdal: import lorikeet-heimdal-200907152325 (commit 2bef9cd5378c01e9c2a74d622176...
[samba.git]
/
source4
/
heimdal
/
lib
/
krb5
/
store_emem.c
diff --git
a/source4/heimdal/lib/krb5/store_emem.c
b/source4/heimdal/lib/krb5/store_emem.c
index 4be89b6564bcfeb20a61f008a87d4ccb90386716..acf984280ee1a16bae20680afb93c35d21f2d106 100644
(file)
--- a/
source4/heimdal/lib/krb5/store_emem.c
+++ b/
source4/heimdal/lib/krb5/store_emem.c
@@
-110,7
+110,12
@@
emem_trunc(krb5_storage *sp, off_t offset)
* If offset is larget then current size, or current size is
* shrunk more then half of the current size, adjust buffer.
*/
* If offset is larget then current size, or current size is
* shrunk more then half of the current size, adjust buffer.
*/
- if (offset > s->size || (s->size / 2) > offset) {
+ if (offset == 0) {
+ free(s->base);
+ s->size = 0;
+ s->base = NULL;
+ s->ptr = NULL;
+ } else if (offset > s->size || (s->size / 2) > offset) {
void *base;
size_t off;
off = s->ptr - s->base;
void *base;
size_t off;
off = s->ptr - s->base;