projects
/
nextcloud-desktop.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
eacc0c8
)
Fix pot. mem leak found by coverity (CID 96004)
author
Daniel Molkentin
<danimo@owncloud.com>
Tue, 24 May 2016 09:21:25 +0000
(11:21 +0200)
committer
Daniel Molkentin
<danimo@owncloud.com>
Tue, 24 May 2016 09:21:33 +0000
(11:21 +0200)
src/3rdparty/certificates/p12topem.cpp
patch
|
blob
|
history
diff --git
a/src/3rdparty/certificates/p12topem.cpp
b/src/3rdparty/certificates/p12topem.cpp
index 75e736a7abf33a7717d1b04acddafebe0c401ac2..bf6a83c4e3eb50be577545adf7ffec555662ec68 100644
(file)
--- a/
src/3rdparty/certificates/p12topem.cpp
+++ b/
src/3rdparty/certificates/p12topem.cpp
@@
-28,16
+28,12
@@
* \return string PEM
*/
string x509ToString(BIO *o) {
- int len = 0;
BUF_MEM *bptr;
- void* data;
- string ret = "";
-
BIO_get_mem_ptr(o, &bptr);
- len = bptr->length;
- data = calloc(len+10, sizeof(char));
+
int
len = bptr->length;
+
void*
data = calloc(len+10, sizeof(char));
BIO_read(o, data, len);
-
ret = strdup((char*)data
);
+
string ret = std::string(static_cast<char*>(data)
);
free(data);
return ret;