- Subject: [slang-users] intrinsic curl_easy_escape sample
- From: "Brian McQueen" <mcqueenorama@xxxxxxxxx>
- Date: Wed, 7 Mar 2007 16:47:47 -0800
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);
}
[2007 date index]
[2007 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]