]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
stasis_recording: Correct ast_asprintf error checking
authorSean Bright <sean.bright@gmail.com>
Tue, 30 May 2017 21:07:56 +0000 (17:07 -0400)
committerSean Bright <sean.bright@gmail.com>
Tue, 30 May 2017 21:09:50 +0000 (16:09 -0500)
ASTERISK-27021 #close
Reported by: Tim Morgan

Change-Id: I0ac061f040093e806c3b1f4e2340864f3ce4dd75

res/stasis_recording/stored.c

index 23d535604b92334e94247c93d2227f5e0c6b853f..9df5d75dc6773410d9e29a6c9af4b235ff782dd6 100644 (file)
@@ -173,7 +173,7 @@ static int handle_find_recording(const char *dir_name, const char *filename, voi
                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;
        }
 
@@ -268,7 +268,7 @@ static int handle_scan_file(const char *dir_name, const char *filename, void *ob
                return 0;
        }
 
-       if (ast_asprintf(&filepath, "%s/%s", dir_name, filename)) {
+       if (ast_asprintf(&filepath, "%s/%s", dir_name, filename) < 0) {
                return -1;
        }