[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 10/153: smb: fix memory-leak in URL parse error pat
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 10/153: smb: fix memory-leak in URL parse error path |
Date: |
Tue, 11 Sep 2018 12:51:21 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit 5b511b0958f06f72c99494364cbb8f33c4900dd4
Author: Daniel Stenberg <address@hidden>
AuthorDate: Thu Jul 12 11:44:57 2018 +0200
smb: fix memory-leak in URL parse error path
Detected by OSS-Fuzz
Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9369
Closes #2740
---
lib/smb.c | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
diff --git a/lib/smb.c b/lib/smb.c
index 9ac61505c..fad636252 100644
--- a/lib/smb.c
+++ b/lib/smb.c
@@ -969,11 +969,9 @@ static CURLcode smb_parse_url_path(struct connectdata
*conn)
/* Parse the path for the share */
req->share = strdup((*path == '/' || *path == '\\') ? path + 1 : path);
- if(!req->share) {
- free(path);
-
+ free(path);
+ if(!req->share)
return CURLE_OUT_OF_MEMORY;
- }
slash = strchr(req->share, '/');
if(!slash)
@@ -981,8 +979,7 @@ static CURLcode smb_parse_url_path(struct connectdata *conn)
/* The share must be present */
if(!slash) {
- free(path);
-
+ Curl_safefree(req->share);
return CURLE_URL_MALFORMAT;
}
@@ -995,8 +992,6 @@ static CURLcode smb_parse_url_path(struct connectdata *conn)
*slash = '\\';
}
- free(path);
-
return CURLE_OK;
}
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 16/153: RELEASE-NOTES: sync, (continued)
- [GNUnet-SVN] [gnurl] 16/153: RELEASE-NOTES: sync, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 13/153: darwinssl: add support for ALPN negotiation, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 34/153: curl: Fix segfault when -H @headerfile is empty, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 27/153: reuse_conn(): free old_conn->options, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 08/153: docs/SECURITY-PROCESS: mention bounty, drop pre-notify, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 19/153: http2: several cleanups, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 02/153: schannel: fix MinGW compile break, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 04/153: conn: remove the boolean 'inuse' field, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 20/153: test214: disable MSYS2's POSIX path conversion for URL, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 12/153: test1422: add required file feature, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 10/153: smb: fix memory-leak in URL parse error path,
gnunet <=
- [GNUnet-SVN] [gnurl] 32/153: docs/examples: add hiperfifo example using linux epoll/timerfd, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 30/153: docs/CURLOPT_URL: fix indentation, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 31/153: docs/INSTALL.md: minor formatting fixes, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 18/153: smb_getsock: always wait for write socket too, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 17/153: test1143: disable MSYS2's POSIX path conversion, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 21/153: tests: fixes for Windows line endlings, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 22/153: vtls: set conn->data when closing TLS, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 11/153: content_encoding: accept up to 4 unknown trailer bytes after raw deflate data, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 07/153: multi: always do the COMPLETED procedure/state, gnunet, 2018/09/11
- [GNUnet-SVN] [gnurl] 09/153: schannel: enable CALG_TLS1PRF for w32api >= 5.1, gnunet, 2018/09/11