Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

presence_dialoginfo: Fix memory leak in dlginfo_agg_nbody. #174

Merged
merged 1 commit into from Mar 10, 2014

Conversation

wdoekes
Copy link
Contributor

@wdoekes wdoekes commented Mar 5, 2014

This commit fixes a couple of presence issues (introduced in 80c48e6):

  • There was a memory leak in dlginfo_agg_nbody.
  • Bounds checking in dlginfo_agg_nbody was off by 4 (potential stack
    corruption).
  • There were 2 PKG allocs, straight after one another while no alloc
    was needed at all: reduced to 1 optional one.
  • Replace "dumy" with "dummy" in the vicinity.

This commit fixes a couple of presence issues (introduced in 80c48e6):
 * There was a memory leak in dlginfo_agg_nbody.
 * Bounds checking in dlginfo_agg_nbody was off by 4 (potential stack
   corruption).
 * There were 2 PKG allocs, straight after one another while no alloc
   was needed at all: reduced to 1 optional one.
 * Replace "dumy" with "dummy" in the vicinity.
@wdoekes
Copy link
Contributor Author

wdoekes commented Mar 6, 2014

(I squashes the two commits into one, just now.)

bogdan-iancu added a commit that referenced this pull request Mar 10, 2014
presence_dialoginfo: Fix memory leak in dlginfo_agg_nbody.
@bogdan-iancu bogdan-iancu merged commit 1e02b32 into OpenSIPS:master Mar 10, 2014
bogdan-iancu added a commit that referenced this pull request Mar 10, 2014
presence_dialoginfo: Fix memory leak in dlginfo_agg_nbody.
(cherry picked from commit 1e02b32)
bogdan-iancu added a commit that referenced this pull request Mar 10, 2014
presence_dialoginfo: Fix memory leak in dlginfo_agg_nbody.
(cherry picked from commit 1e02b32)
bogdan-iancu added a commit that referenced this pull request Mar 10, 2014
presence_dialoginfo: Fix memory leak in dlginfo_agg_nbody.
(cherry picked from commit 1e02b32)
@bogdan-iancu
Copy link
Member

Many thanks @wdoekes for this fix !

@dsandras
Copy link
Contributor

Hi,

The leak was fixed in my local branch, and I apparently forgot to push it. Apologies.

About the bound checking error, the code was cut&pasted from another place in the same file where the same error is still present:

Line 165:
/* create the new NOTIFY body */
if ( (pres_user->len + pres_domain->len + 1) > MAX_URI_SIZE) {
LM_ERR("entity URI too long, maximum=%d\n", MAX_URI_SIZE);
return NULL;
}

@bogdan-iancu
Copy link
Member

Hi @dsandras , could you also confirm that the applied patch fixes the mem leaks you are aware about ?

Thanks and regards,
Bogdan

@dsandras
Copy link
Contributor

Hi,

Yes. However, it seems to me that the probability for those leaks to
appear was very weak (only in case of error). The leak was on pres_user
not always being freed, which is not possible anymore as it is not
dynamically allocated anymore.

Le 12/03/14 21:59, Bogdan Andrei IANCU a écrit :

Hi @dsandras https://github.com/dsandras , could you also confirm
that the applied patch fixes the mem leaks you are aware about ?

Thanks and regards,
Bogdan


Reply to this email directly or view it on GitHub
#174 (comment).


Damien SANDRAS

Ekiga Project
http://www.ekiga.org

@wdoekes wdoekes deleted the wjd-fix_dialogaggr_memleak branch September 16, 2015 12:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants