Mercurial > dropbear
comparison cli-authinteract.c @ 339:31743c9bdf78
BUG: The strings 'name' and 'instruction' are always allocated
but are only freed if the length of the string is greater then
zero. They should always be freed.
FIX: take the m_free(<string>) out of the conditional
From Erik Hovland
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Fri, 07 Jul 2006 07:00:10 +0000 |
parents | 475a818dd6e7 |
children | a24139ba08c8 |
comparison
equal
deleted
inserted
replaced
338:1c7a072000e0 | 339:31743c9bdf78 |
---|---|
97 buf_putint(ses.writepayload, num_prompts); | 97 buf_putint(ses.writepayload, num_prompts); |
98 | 98 |
99 if (strlen(name) > 0) { | 99 if (strlen(name) > 0) { |
100 cleantext(name); | 100 cleantext(name); |
101 fprintf(stderr, "%s", name); | 101 fprintf(stderr, "%s", name); |
102 m_free(name); | |
103 } | 102 } |
103 m_free(name); | |
104 | |
104 if (strlen(instruction) > 0) { | 105 if (strlen(instruction) > 0) { |
105 cleantext(instruction); | 106 cleantext(instruction); |
106 fprintf(stderr, "%s", instruction); | 107 fprintf(stderr, "%s", instruction); |
107 m_free(instruction); | |
108 } | 108 } |
109 m_free(instruction); | |
109 | 110 |
110 for (i = 0; i < num_prompts; i++) { | 111 for (i = 0; i < num_prompts; i++) { |
111 unsigned int response_len = 0; | 112 unsigned int response_len = 0; |
112 prompt = buf_getstring(ses.payload, NULL); | 113 prompt = buf_getstring(ses.payload, NULL); |
113 cleantext(prompt); | 114 cleantext(prompt); |