Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
f8245909
Commit
f8245909
authored
4 years ago
by
Sébastien Blin
Browse files
Options
Downloads
Patches
Plain Diff
misc: add missing free and avoid memory leaks
Change-Id: I6cb59c613702348b33b537cf29680d6359b18d4d
parent
e5b55322
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
contrib/src/pjproject/0002-rfc2466.patch
+14
-17
14 additions, 17 deletions
contrib/src/pjproject/0002-rfc2466.patch
with
14 additions
and
17 deletions
contrib/src/pjproject/0002-rfc2466.patch
+
14
−
17
View file @
f8245909
From 753c3c04da7465622d6f0ce2efebdf428fba536f Mon Sep 17 00:00:00 2001
From: jrun <darwinskernel@gmail.com>
Date: Thu, 27 Feb 2020 11:34:40 -0500
Subject: [PATCH 2/9] rfc2466
---
pjnath/src/pjnath/ice_session.c | 170 ++++++++++++++++++++++++++++++++
1 file changed, 170 insertions(+)
pjnath/src/pjnath/ice_session.c | 176 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 176 insertions(+)
diff --git a/pjnath/src/pjnath/ice_session.c b/pjnath/src/pjnath/ice_session.c
index
960c55156..a50c21c9
4 100644
index
2a4125bc5..542acf7b
4 100644
--- a/pjnath/src/pjnath/ice_session.c
+++ b/pjnath/src/pjnath/ice_session.c
@@ -
30
,6 +
30
,21 @@
@@ -
29
,6 +
29
,21 @@
#include <pj/rand.h>
#include <pj/string.h>
...
...
@@ -33,7 +27,7 @@ index 960c55156..a50c21c94 100644
/* String names for candidate types */
static const char *cand_type_names[] =
{
@@ -7
12
,6 +7
27,138
@@
static pj_uint32_t CALC_CAND_PRIO(pj_ice_sess *ice,
@@ -7
03
,6 +7
18,144
@@
static pj_uint32_t CALC_CAND_PRIO(pj_ice_sess *ice,
#endif
}
...
...
@@ -97,6 +91,7 @@ index 960c55156..a50c21c94 100644
+ rtn = recv(fd, read_buffer, pagesize, 0);
+ if(rtn < 0) {
+ perror ("recv(): ");
+ free(deprecatedAddrs);
+ return;
+ }
+
...
...
@@ -105,6 +100,7 @@ index 960c55156..a50c21c94 100644
+
+ if (nlmsg_len < sizeof (struct nlmsghdr)) {
+ perror ("Received an uncomplete netlink packet");
+ free(deprecatedAddrs);
+ return;
+ }
+
...
...
@@ -137,6 +133,7 @@ index 960c55156..a50c21c94 100644
+ (idx + 256)*sizeof(char)*PJ_INET6_ADDRSTRLEN);
+ if (newDeprecated == NULL) {
+ perror("realloc error: abort");
+ free(deprecatedAddrs);
+ return;
+ }
+ deprecatedAddrs = newDeprecated;
...
...
@@ -165,16 +162,19 @@ index 960c55156..a50c21c94 100644
+ *addresses = final;
+ } else {
+ perror("realloc error: abort");
+ free(deprecatedAddrs);
+ }
+ } else {
+ free(deprecatedAddrs);
+ }
+#endif
+}
/*
* Add ICE candidate
@@ -7
2
9,6 +87
6
,29 @@
PJ_DEF(pj_status_t) pj_ice_sess_add_cand(pj_ice_sess *ice,
unsigned *p_cand_id
,
pj_ice_cand_transport transport
)
@@ -7
1
9,6 +87
2
,29 @@
PJ_DEF(pj_status_t) pj_ice_sess_add_cand(pj_ice_sess *ice,
int addr_len
,
unsigned *p_cand_id
)
{
+ /**
+ * RFC 2466: an ip address can have the status DEPRECATED and SHOULD NOT
...
...
@@ -202,6 +202,3 @@ index 960c55156..a50c21c94 100644
pj_ice_sess_cand *lcand;
pj_status_t status = PJ_SUCCESS;
char address[PJ_INET6_ADDRSTRLEN];
--
2.24.1
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment