summaryrefslogtreecommitdiff
path: root/libs/backends
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-08-19 14:38:22 +0200
committerRobin Gareus <robin@gareus.org>2016-08-19 14:38:37 +0200
commitcdcccd8101b550730f3e970e633c1eb9e0a26295 (patch)
tree18c7a2608f29cdb48b04ceb747240b8874c6cbf8 /libs/backends
parent45cd3482a2bfce98b7a4fff79c148ef2d2dbd847 (diff)
handle edge-case where jack-meta-data may be NULL, but the call succeeds
this fixes #6968
Diffstat (limited to 'libs/backends')
-rw-r--r--libs/backends/jack/jack_portengine.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/libs/backends/jack/jack_portengine.cc b/libs/backends/jack/jack_portengine.cc
index 934f8b5d9e..98d2744d7a 100644
--- a/libs/backends/jack/jack_portengine.cc
+++ b/libs/backends/jack/jack_portengine.cc
@@ -135,12 +135,15 @@ JACKAudioBackend::get_port_property (PortHandle port, const std::string& key, st
jack_uuid_t uuid = jack_port_uuid((jack_port_t*) port);
rv = jack_get_property(uuid, key.c_str(), &cvalue, &ctype);
- if (0 == rv) {
+ if (0 == rv && cvalue && ctype) {
value = cvalue;
type = ctype;
- jack_free(cvalue);
- jack_free(ctype);
+ } else {
+ rv = -1;
}
+
+ jack_free(cvalue);
+ jack_free(ctype);
return rv;
#else
return -1;