app_jack: fix datastore memory leak in error handling path.
authorRussell Bryant <russell@russellbryant.com>
Sat, 24 Mar 2012 03:03:20 +0000 (03:03 +0000)
committerRussell Bryant <russell@russellbryant.com>
Sat, 24 Mar 2012 03:03:20 +0000 (03:03 +0000)
........

Merged revisions 360360 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 360361 from http://svn.asterisk.org/svn/asterisk/branches/10

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360362 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_jack.c

index 46024ff..10964f4 100644 (file)
@@ -904,8 +904,14 @@ static int enable_jack_hook(struct ast_channel *chan, char *data)
 return_error:
        ast_channel_unlock(chan);
 
-       if (jack_data)
+       if (jack_data) {
                destroy_jack_data(jack_data);
+       }
+
+       if (datastore) {
+               datastore->data = NULL;
+               ast_datastore_free(datastore);
+       }
 
        return -1;
 }