Small memory leak in the status cache code

David Carter dpc22 at cam.ac.uk
Wed Jan 30 08:48:31 EST 2008


There is a small memory leak in the status cache code. Or at least I don't 
believe that DB->store() automatically free()s its input.

Probably faster to just have a "char data[250]" on the stack.

-- 
David Carter                             Email: David.Carter at ucs.cam.ac.uk
University Computing Service,            Phone: (01223) 334502
New Museums Site, Pembroke Street,       Fax:   (01223) 334679
Cambridge UK. CB2 3QH.


Index: imap/statuscache_db.c
===================================================================
RCS file: /cvs/src/cyrus/imap/statuscache_db.c,v
retrieving revision 1.1
diff -u -d -r1.1 statuscache_db.c
--- imap/statuscache_db.c       18 Jan 2008 19:17:09 -0000      1.1
+++ imap/statuscache_db.c       30 Jan 2008 13:44:04 -0000
@@ -247,6 +247,7 @@
         syslog(LOG_ERR, "DBERROR: error updating database: %s",
                cyrusdb_strerror(r));
      }
+    free(data);
      return 0;
  }



More information about the Cyrus-devel mailing list