[Home]

Summary:ASTERISK-07080: [patch] [need disclaimer] memory leakage in callerid.c
Reporter:Konstantin Prokazoff (oryx)Labels:
Date Opened:2006-06-02 01:49:00Date Closed:2006-06-06 11:04:52
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) alamantia_patch01.diff
Description:Malloc'ed memory in some cases willn't be freed at return from function.
Comments:By: Serge Vecher (serge-v) 2006-06-02 08:31:42

any more details that you can provide: a code snippet, perhaps? Why do you believe there is a memory leakage?

By: Konstantin Prokazoff (oryx) 2006-06-02 09:12:10

If you'll analyze source, you'll see.
I'll post patch asap.

By: Anthony LaMantia (alamantia) 2006-06-02 10:51:28

free(obuf); needs to be placed on lines

281
286
314
and 399

on all of these returns the allocated memory for obuf
allocated here.

short *buf = malloc(2 * len + cid->oldlen);
short *obuf = buf;

is never free()'ed

directly after the malloc call, it is checked to see if it has been executaed safley on line 267.

so at all of the return's after that check obuf should be free()'ed to prevent memory problems.

I will post a patch later today.

-Anthony



By: Anthony LaMantia (alamantia) 2006-06-02 10:58:24

i uploaded the .diff.
-anthony

By: Anthony LaMantia (alamantia) 2006-06-02 11:24:17

let me update the diff from the latest SNV code.

By: BJ Weschke (bweschke) 2006-06-02 11:55:09

alamantia - Oryx - good catches. You guys have disclaimers on file?

By: Anthony LaMantia (alamantia) 2006-06-02 14:52:35

i dont have a disclaimer, but feel free to do what you want with the diff.

By: Russell Bryant (russell) 2006-06-04 16:16:13

Unfortunately, just making that statement is not enough.  We need a disclaimer on file before we can review your proposed code changes.  Thanks ...

By: Serge Vecher (serge-v) 2006-06-05 09:00:19

alamantia: see the bottom of this page for instructions http://bugs.digium.com/main_page.php . Thanks

By: Serge Vecher (serge-v) 2006-06-05 09:00:37



By: Brian West (bkw918) 2006-06-05 12:16:16

This patch shouldn't need a disclaimer at all unless someone magically took over the copyright to all "free" calls in the world.

/b

By: Brian West (bkw918) 2006-06-05 12:16:57

He is adding THREE FREAKING calls to "free" and you need a disclaimer?

/b

By: Tilghman Lesher (tilghman) 2006-06-06 11:04:52

Patch is simply functional and is not large enough to be copyrightable.  Committed to 1.2, merged to trunk.