Minor chan_nbs fix
authorMark Spencer <markster@digium.com>
Wed, 9 Apr 2003 04:22:25 +0000 (04:22 +0000)
committerMark Spencer <markster@digium.com>
Wed, 9 Apr 2003 04:22:25 +0000 (04:22 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@793 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_nbs.c

index f1fd22f..f366f97 100755 (executable)
@@ -244,9 +244,11 @@ static struct ast_channel *nbs_request(char *type, int format, void *data)
                return NULL;
        }
        p = nbs_alloc(data);
-       tmp = nbs_new(p, AST_STATE_DOWN);
-       if (!tmp)
-               nbs_destroy(p);
+       if (p) {
+               tmp = nbs_new(p, AST_STATE_DOWN);
+               if (!tmp)
+                       nbs_destroy(p);
+       }
        return tmp;
 }