diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2006-12-10 10:10:25 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2006-12-10 10:10:25 +0000 |
commit | 02bc4513f770774de6d7af5cf6510bf263a306fb (patch) | |
tree | e7a33b83dea49a46fab5e185bd39dce76305951f | |
parent | a052f97a0f134fcf59538da6bf87203a52e1b9b0 (diff) | |
download | mailfromd-02bc4513f770774de6d7af5cf6510bf263a306fb.tar.gz mailfromd-02bc4513f770774de6d7af5cf6510bf263a306fb.tar.bz2 |
(get_rate): Bug fix: attempt to free auto storage
git-svn-id: file:///svnroot/mailfromd/branches/release_3_1_patches@1104 7a8a7f39-df28-0410-adc6-e0d955640f24
-rw-r--r-- | src/rate.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -36,6 +36,7 @@ get_rate(char *email, double *ret) DBM_FILE db; DBM_DATUM key; DBM_DATUM contents; + int local_contents = 0; struct rate_result *rp, rate; double result; time_t t; @@ -67,6 +68,7 @@ get_rate(char *email, double *ret) rate.interval = 0; rate.count = 0; rp = &rate; + local_contents = 1; } /* Update the structure */ @@ -94,7 +96,8 @@ get_rate(char *email, double *ret) if (mu_dbm_insert(&db, key, contents, 1)) mu_error ("Cannot insert datum"); - mu_dbm_datum_free(&contents); + if (!local_contents) + mu_dbm_datum_free(&contents); mu_dbm_close(&db); *ret = result; |