diff options
| author | Rob Crittenden <rcritten@redhat.com> | 2009-05-22 18:16:42 -0400 |
|---|---|---|
| committer | Rob Crittenden <rcritten@redhat.com> | 2009-05-22 18:16:42 -0400 |
| commit | f32266d0b8d4bfa2f228c0d3c3ed9869a2b3eb50 (patch) | |
| tree | b81ffc91b2f309994967d1b4ea063f9098a27c6f | |
| parent | 99dd57c020efec97519ee46d29229d3df8914026 (diff) | |
Fix off-by-one error when computing size to reduce memory leak.
Patch contributed by Kamil Dudka.
483855
| -rw-r--r-- | pobject.c | 5 |
1 files changed, 1 insertions, 4 deletions
@@ -987,10 +987,7 @@ pem_CreateObject char *ivstring = NULL; count = pem_nobjs; - if (count > 0) - size = ((count / PEM_ITEM_CHUNK) + 1) * PEM_ITEM_CHUNK; - else - size = 0; + size = (count / PEM_ITEM_CHUNK) * PEM_ITEM_CHUNK; /* * only create token objects |
