Found by Coverity:

47QStringList V4lCaptureHandler::getDeviceName(QString input)
 48{
 49
CID 709299: Resource leak (RESOURCE_LEAK)
Calling allocation function "strdup".
Assigning: "src" = storage returned from 
"strdup(QByteArray(input.toUtf8()).constData())".
 50    char *src = strdup(input.toUtf8().constData());
 51    QString pixelformatdescription;
Variable "src" is not freed or pointed-to in function "open".
 52    int fd = open(src, O_RDWR | O_NONBLOCK);
At conditional (1): "fd < 0" taking the false branch.
...
124    close(fd);
125
126    QStringList result;
At conditional (6): "devName == NULL" taking the true branch.
Variable "src" going out of scope leaks the storage it points to.
127    if (devName == NULL) return result;
128    QString deviceName(devName);
129    result << (deviceName.isEmpty() ? input : deviceName) << 
pixelformatdescription;
130    return result;
131}
---
 src/v4l/v4lcapture.cpp |    1 +
 1 file changed, 1 insertion(+)

diff --git a/src/v4l/v4lcapture.cpp b/src/v4l/v4lcapture.cpp
index 4b7af82..ada255b 100644
--- a/src/v4l/v4lcapture.cpp
+++ b/src/v4l/v4lcapture.cpp
@@ -122,6 +122,7 @@ QStringList V4lCaptureHandler::getDeviceName(QString input)
         }
     }
     close(fd);
+    delete[] src;
 
     QStringList result;
     if (devName == NULL) return result; 
-- 
1.7.10.4


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Kdenlive-devel mailing list
Kdenlive-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kdenlive-devel

Reply via email to