projects
/
citadel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b2d98b7
)
CtdlSaveMsgPointersInRoom() is now lmdb-safe
author
Art Cancro
<ajc@citadel.org>
Thu, 17 Aug 2023 22:20:49 +0000
(13:20 -0900)
committer
Art Cancro
<ajc@citadel.org>
Thu, 17 Aug 2023 22:20:49 +0000
(13:20 -0900)
citadel/server/msgbase.c
patch
|
blob
|
history
diff --git
a/citadel/server/msgbase.c
b/citadel/server/msgbase.c
index d01a50577ad5f471a6dfe44d092704ed0de43b2d..6b5aec0e1de25bd69eba548c0f954260c7a1a1a5 100644
(file)
--- a/
citadel/server/msgbase.c
+++ b/
citadel/server/msgbase.c
@@
-3221,9
+3221,9
@@
int CtdlDeleteMessages(const char *room_name, // which room
if (cdbfr != NULL) {
dellist = malloc(cdbfr->len);
- msglist = (long *) cdbfr->ptr;
- cdbfr->ptr = NULL; // CtdlDeleteMessages() now owns this memory (this needs attention if we move to LMDB)
num_msgs = cdbfr->len / sizeof(long);
+ msglist = (long *) malloc(cdbfr->len);
+ memcpy(msglist, cdbfr->ptr, cdbfr->len);
cdb_free(cdbfr);
}
if (num_msgs > 0) {