summaryrefslogtreecommitdiffstats
path: root/generic/tkSelect.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2005-11-22 11:16:25 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2005-11-22 11:16:25 (GMT)
commit0413253535483006c8686520a48238a8983fa3a5 (patch)
treecb87969eb0193f05ae2fa4e90ef9fbd32164f3ef /generic/tkSelect.c
parent917a5e166f3b61cad2cb50c88b051c05ae95d4b2 (diff)
downloadtk-0413253535483006c8686520a48238a8983fa3a5.zip
tk-0413253535483006c8686520a48238a8983fa3a5.tar.gz
tk-0413253535483006c8686520a48238a8983fa3a5.tar.bz2
Plug potential memory leak...
Diffstat (limited to 'generic/tkSelect.c')
-rw-r--r--generic/tkSelect.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/generic/tkSelect.c b/generic/tkSelect.c
index 4d8617e..c35a47c 100644
--- a/generic/tkSelect.c
+++ b/generic/tkSelect.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkSelect.c,v 1.18 2005/11/17 16:21:56 dkf Exp $
+ * RCS: @(#) $Id: tkSelect.c,v 1.19 2005/11/22 11:16:25 dkf Exp $
*/
#include "tkInt.h"
@@ -1499,6 +1499,7 @@ TkSelDefaultSelection(
}
length = Tcl_DStringLength(&ds);
if (length >= maxBytes) {
+ Tcl_DStringFree(&ds);
return -1;
}
memcpy(buffer, Tcl_DStringValue(&ds), (unsigned) (1+length));