Skip to content
Snippets Groups Projects
Unverified Commit b322fb79 authored by Sébastien Blin's avatar Sébastien Blin
Browse files

pjproject: remove realloc error dummy log

If there is no deprecated addresses, realloc will not allocate
memory.

Change-Id: I3c783b0939d892072354b244c4cafabeef4501cb
parent 9f009c7e
No related branches found
No related tags found
No related merge requests found
...@@ -5,11 +5,11 @@ Subject: [PATCH 1/1] RFC 2466: ignore deprecated candidates for new ICE ...@@ -5,11 +5,11 @@ Subject: [PATCH 1/1] RFC 2466: ignore deprecated candidates for new ICE
candidates candidates
--- ---
pjnath/src/pjnath/ice_session.c | 162 ++++++++++++++++++++++++++++++++ pjnath/src/pjnath/ice_session.c | 162 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 162 insertions(+) 1 file changed, 162 insertions(+)
diff --git a/pjnath/src/pjnath/ice_session.c b/pjnath/src/pjnath/ice_session.c diff --git a/pjnath/src/pjnath/ice_session.c b/pjnath/src/pjnath/ice_session.c
index 63a0d1c9..6cae6b2e 100644 index c51dba77..a5c7a5b0 100644
--- a/pjnath/src/pjnath/ice_session.c --- a/pjnath/src/pjnath/ice_session.c
+++ b/pjnath/src/pjnath/ice_session.c +++ b/pjnath/src/pjnath/ice_session.c
@@ -29,6 +29,21 @@ @@ -29,6 +29,21 @@
...@@ -149,16 +149,16 @@ index 63a0d1c9..6cae6b2e 100644 ...@@ -149,16 +149,16 @@ index 63a0d1c9..6cae6b2e 100644
+ +
+ close(fd); + close(fd);
+ *size = idx; + *size = idx;
+ if (idx > 0) {
+ char *final = realloc(deprecatedAddrs, idx*sizeof(char)*PJ_INET6_ADDRSTRLEN); + char *final = realloc(deprecatedAddrs, idx*sizeof(char)*PJ_INET6_ADDRSTRLEN);
+ if (!final) { + if (final) {
+ perror("realloc error: abort");
+ return;
+ } else {
+ *addresses = final; + *addresses = final;
+ } else {
+ perror("realloc error: abort");
+ }
+ } + }
+#endif +#endif
+} +}
+
+ +
/* /*
...@@ -195,5 +195,3 @@ index 63a0d1c9..6cae6b2e 100644 ...@@ -195,5 +195,3 @@ index 63a0d1c9..6cae6b2e 100644
pj_ice_sess_cand *lcand; pj_ice_sess_cand *lcand;
pj_status_t status = PJ_SUCCESS; pj_status_t status = PJ_SUCCESS;
char address[PJ_INET6_ADDRSTRLEN]; char address[PJ_INET6_ADDRSTRLEN];
--
2.17.1
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment