summaryrefslogtreecommitdiff
path: root/src/htsbauth.c
diff options
context:
space:
mode:
authorXavier Roche <xroche@users.noreply.github.com>2014-05-29 08:20:07 +0000
committerXavier Roche <xroche@users.noreply.github.com>2014-05-29 08:20:07 +0000
commitae6d05fbb30ca8c0370b2be8cc1810b028616830 (patch)
tree0b7a239bbf51f74348f52a2281020cae5e2d2575 /src/htsbauth.c
parent803f7b5a33c74ced027f3a171a6a7966206d4e1d (diff)
Allocation cleanup (why "+2", why ?)
Diffstat (limited to 'src/htsbauth.c')
-rw-r--r--src/htsbauth.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/htsbauth.c b/src/htsbauth.c
index 9d9ea7c..fb40a8b 100644
--- a/src/htsbauth.c
+++ b/src/htsbauth.c
@@ -343,7 +343,7 @@ void cookie_insert(char *s, const char *ins) {
if (strnotempty(s) == 0) { // rien à faire, juste concat
strcatbuff(s, ins);
} else {
- buff = (char *) malloct(strlen(s) + 2);
+ buff = (char *) malloct(strlen(s) + 1);
if (buff) {
strcpybuff(buff, s); // copie temporaire
strcpybuff(s, ins); // insérer
@@ -360,7 +360,7 @@ void cookie_delete(char *s, size_t pos) {
if (strnotempty(s + pos) == 0) { // rien à faire, effacer
s[0] = '\0';
} else {
- buff = (char *) malloct(strlen(s + pos) + 2);
+ buff = (char *) malloct(strlen(s + pos) + 1);
if (buff) {
strcpybuff(buff, s + pos); // copie temporaire
strcpybuff(s, buff); // copier