Enlightenment CVS committal

Author  : gilbertt
Project : misc
Module  : camE

Dir     : misc/camE


Modified Files:
        webcam.c 


Log Message:

Whoops. Feeding libcurl strings and then freeing them makes it mostly
unhappy...


===================================================================
RCS file: /cvsroot/enlightenment/misc/camE/webcam.c,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -3 -r1.61 -r1.62
--- webcam.c    15 Mar 2003 15:25:54 -0000      1.61
+++ webcam.c    26 Mar 2003 08:54:12 -0000      1.62
@@ -905,7 +905,8 @@
   CURLcode ret;
   struct stat st;
   static struct curl_slist *post_commands = NULL;
-  char *passwd_string, *url_string;
+  static char *passwd_string = NULL;
+  static char *url_string = NULL;
 
   infile = fopen(local, "r");
 
@@ -928,14 +929,16 @@
     curl_handle = curl_easy_init();
     connections++;
 
+    if (passwd_string)
+      free(passwd_string);
     passwd_string = gib_strjoin(":", ftp_user, ftp_pass, NULL);
     curl_easy_setopt(curl_handle, CURLOPT_USERPWD, passwd_string);
-    free(passwd_string);
 
     /* set URL to save to */
+    if (url_string)
+      free(url_string);
     url_string = gib_strjoin("/", "ftp:/", ftp_host, ftp_dir, tmp, NULL);
     curl_easy_setopt(curl_handle, CURLOPT_URL, url_string);
-    free(url_string);
 
     /* no progress meter please */
     curl_easy_setopt(curl_handle, CURLOPT_NOPROGRESS, 1);




-------------------------------------------------------
This SF.net email is sponsored by:
The Definitive IT and Networking Event. Be There!
NetWorld+Interop Las Vegas 2003 -- Register today!
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to