[slang-users] intrinsic curl_easy_escape sample

Brian McQueen mcqueenorama at gmail.com
Wed Mar 7 19:47:47 EST 2007


Here is an attempt with a known problem.  curl_easy_escape actually
mallocs for its returned string, which means this thing has a memory
leak.  I figure that means I need to turn it into a memory managed
thing.  What do you think of this?

Also I don't know what the hashed strings are.  Could you say a word
about those?

Here is the sample:


static void escape_intrin (void)
{
   SLang_MMT_Type *mmt;
   Easy_Type *ez;
   char *unescaped_string = NULL;
   char *esc_string = NULL;

   if (-1 == SLpop_string (&unescaped_string))
        return;

   if (NULL == (mmt = pop_easy_type (&ez, 0)))
     return;

   esc_string = curl_easy_escape(ez->handle, unescaped_string, 0);

   if (esc_string == NULL)
        return;

   (void) SLang_push_string (esc_string);

   SLfree(unescaped_string);
   SLang_free_mmt (mmt);
}


More information about the slang-users-l mailing list