aboutsummaryrefslogtreecommitdiffstats
path: root/missing
diff options
context:
space:
mode:
authorrhe <rhe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-12 15:55:04 +0000
committerrhe <rhe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-12 15:55:04 +0000
commita6e5353b925284b219af708bbaf34c45bc7a69b9 (patch)
treeed1265b036070f690985fa83057df9e0f2502ec3 /missing
parentace7071befc6d939110cf14dbec56fa1e9d6cec7 (diff)
downloadruby-a6e5353b925284b219af708bbaf34c45bc7a69b9.tar.gz
string.c: fix memory leak in String#crypt
Use ALLOCV to allocate struct crypt_data for slightly cleaner and less error-prone code. It is currently possible it leaks when an invalid argument is passed to String#crypt or rb_str_new_cstr() fails to allocate memory. SIZEOF_CRYPT_DATA macro in missing/crypt.h is removed since it is not used any longer. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60748 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'missing')
-rw-r--r--missing/crypt.h2
1 files changed, 0 insertions, 2 deletions
diff --git a/missing/crypt.h b/missing/crypt.h
index 7a78767931..7c2642f593 100644
--- a/missing/crypt.h
+++ b/missing/crypt.h
@@ -237,8 +237,6 @@ struct crypt_data {
char cryptresult[1+4+4+11+1]; /* encrypted result */
};
-#define SIZEOF_CRYPT_DATA (KS_SIZE*8+(1+4+4+11+1))
-
char *crypt(const char *key, const char *setting);
void setkey(const char *key);
void encrypt(char *block, int flag);