summaryrefslogtreecommitdiffstats
path: root/65.patch
diff options
context:
space:
mode:
Diffstat (limited to '65.patch')
-rw-r--r--65.patch42
1 files changed, 42 insertions, 0 deletions
diff --git a/65.patch b/65.patch
new file mode 100644
index 0000000..43fed80
--- /dev/null
+++ b/65.patch
@@ -0,0 +1,42 @@
+From d3afedb016aa319246177a3c516ca4804f08dd45 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@remirepo.net>
+Date: Fri, 22 Feb 2019 15:19:18 +0100
+Subject: [PATCH] fix string free
+
+---
+ .gitignore | 2 ++
+ smbclient.c | 6 ++++--
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/smbclient.c b/smbclient.c
+index 81ebd5a..faeb505 100644
+--- a/smbclient.c
++++ b/smbclient.c
+@@ -1345,15 +1345,17 @@ PHP_FUNCTION(smbclient_read)
+
+ if ((ZSTR_LEN(buf) = smbc_read(state->ctx, file, ZSTR_VAL(buf), count)) >= 0) {
+ RETURN_STR(buf);
++ }
++ zend_string_release(buf);
+ #else
+ void *buf = emalloc(count);
+ ssize_t nbytes;
+
+ if ((nbytes = smbc_read(state->ctx, file, buf, count)) >= 0) {
+ RETURN_STRINGL(buf, nbytes, 0);
+-#endif
+ }
+ efree(buf);
++#endif
+ switch (state->err = errno) {
+ case EISDIR: php_error(E_WARNING, "Read error: Is a directory"); break;
+ case EBADF: php_error(E_WARNING, "Read error: Not a valid file resource or not open for reading"); break;
+@@ -1738,7 +1740,7 @@ PHP_FUNCTION(smbclient_removexattr)
+ PHP_FUNCTION(smbclient_option_get)
+ {
+ zend_long option;
+- char *ret;
++ const char *ret;
+ zval *zstate;
+ php_smbclient_state *state;
+