[Asterisk-code-review] stasis recording: Correct ast asprintf error checking (asterisk[14])

Sean Bright asteriskteam at digium.com
Tue May 30 16:09:42 CDT 2017


Sean Bright has uploaded a new change for review. ( https://gerrit.asterisk.org/5740 )

Change subject: stasis_recording: Correct ast_asprintf error checking
......................................................................

stasis_recording: Correct ast_asprintf error checking

ASTERISK-27021 #close
Reported by: Tim Morgan

Change-Id: I0ac061f040093e806c3b1f4e2340864f3ce4dd75
---
M res/stasis_recording/stored.c
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/40/5740/1

diff --git a/res/stasis_recording/stored.c b/res/stasis_recording/stored.c
index e0fd4db..855fd36 100644
--- a/res/stasis_recording/stored.c
+++ b/res/stasis_recording/stored.c
@@ -175,7 +175,7 @@
 		return 0;
 	}
 
-	if (ast_asprintf(&data->file_with_ext, "%s/%s", dir_name, filename)) {
+	if (ast_asprintf(&data->file_with_ext, "%s/%s", dir_name, filename) < 0) {
 		return -1;
 	}
 
@@ -270,7 +270,7 @@
 		return 0;
 	}
 
-	if (ast_asprintf(&filepath, "%s/%s", dir_name, filename)) {
+	if (ast_asprintf(&filepath, "%s/%s", dir_name, filename) < 0) {
 		return -1;
 	}
 

-- 
To view, visit https://gerrit.asterisk.org/5740
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0ac061f040093e806c3b1f4e2340864f3ce4dd75
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 14
Gerrit-Owner: Sean Bright <sean.bright at gmail.com>



More information about the asterisk-code-review mailing list