res_pjproject.c: Fix ast_strdup() alloc failure.
authorRichard Mudgett <rmudgett@digium.com>
Tue, 7 Nov 2017 12:56:08 +0000 (06:56 -0600)
committerRichard Mudgett <rmudgett@digium.com>
Tue, 7 Nov 2017 13:11:32 +0000 (08:11 -0500)
Change-Id: I74688038e7afe3a279359cce53aadb28ade51ead

res/res_pjproject.c

index 86b2502..6137898 100644 (file)
@@ -234,7 +234,7 @@ static void capture_buildopts_cb(int level, const char *data, int len)
        }
 
        dup = ast_strdup(ast_skip_blanks(data));
-       if (AST_VECTOR_ADD_SORTED(&buildopts, dup, strcmp)) {
+       if (dup && AST_VECTOR_ADD_SORTED(&buildopts, dup, strcmp)) {
                ast_free(dup);
        }
 }