]> granicus.if.org Git - curl/commitdiff
memory leak
authorDaniel Stenberg <daniel@haxx.se>
Sat, 18 Oct 2003 20:24:20 +0000 (20:24 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 18 Oct 2003 20:24:20 +0000 (20:24 +0000)
lib/telnet.c

index d01ae25bbfefd6d02cdfd068f1e6851e9e7adc49..64715b0ddae76d66af60581ed4109fc8315fcb06 100644 (file)
@@ -753,8 +753,7 @@ static int check_telnet_options(struct connectdata *conn)
      was given on the command line */
   if(conn->bits.user_passwd)
   {
-    char *buf = malloc(256);
-    sprintf(buf, "USER,%s", conn->user);
+    snprintf(option_arg, sizeof(option_arg), "USER,%s", conn->user);
     tn->telnet_vars = curl_slist_append(tn->telnet_vars, buf);
 
     tn->us_preferred[CURL_TELOPT_NEW_ENVIRON] = CURL_YES;