path: root/missing
diff options
authorrhe <rhe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-12 15:55:04 (GMT)
committerrhe <rhe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-11-12 15:55:04 (GMT)
commit0b845a845811f4b48e5bfdaa1ba1e2fc5f50dccc (patch)
treeed1265b036070f690985fa83057df9e0f2502ec3 /missing
parent4eb345707644e2db631d3af7f455dd976391c466 (diff)
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:// b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'missing')
1 files changed, 0 insertions, 2 deletions
diff --git a/missing/crypt.h b/missing/crypt.h
index 7a78767..7c2642f 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);