Changeset ddbbcffa for functions.c
- Timestamp:
- Feb 11, 2011, 4:31:42 PM (14 years ago)
- Branches:
- master, release-1.10, release-1.8, release-1.9
- Children:
- d4927a7
- Parents:
- 35b6eb9
- git-author:
- Anders Kaseorg <andersk@mit.edu> (08/27/09 00:52:41)
- git-committer:
- Anders Kaseorg <andersk@mit.edu> (02/11/11 16:31:42)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
functions.c
r96828e4 rddbbcffa 32 32 char *rv; 33 33 rv=owl_function_command(cmdbuff); 34 if (rv) owl_free(rv);34 if (rv) g_free(rv); 35 35 } 36 36 … … 89 89 owl_fmtext_append_normal(&fm, "\n"); 90 90 owl_function_popless_fmtext(&fm); 91 owl_list_cleanup(&l, owl_free);91 owl_list_cleanup(&l, g_free); 92 92 owl_fmtext_cleanup(&fm); 93 93 } … … 100 100 (int)(timer->time - time(NULL))); 101 101 owl_fmtext_append_normal(fm, str); 102 owl_free(str);102 g_free(str); 103 103 if (timer->interval) { 104 104 str = owl_sprintf(", repeat every %d seconds", timer->interval); 105 105 owl_fmtext_append_normal(fm, str); 106 owl_free(str);106 g_free(str); 107 107 } 108 108 owl_fmtext_append_normal(fm, "\n"); … … 218 218 char *result = owl_sprintf("%s%s", message, perlquickstart); 219 219 owl_function_adminmsg("BarnOwl Quickstart", result); 220 owl_free(result);221 owl_free(perlquickstart);220 g_free(result); 221 g_free(perlquickstart); 222 222 return; 223 223 } … … 313 313 s = owl_sprintf("----> %s\n", line); 314 314 owl_editwin_set_locktext(e, s); 315 owl_free(s);315 g_free(s); 316 316 317 317 owl_editwin_set_cbdata(e, data, cleanup); … … 359 359 &owl_callback_aimwrite, 360 360 owl_strdup(to), 361 owl_free);362 owl_free(line);361 g_free); 362 g_free(line); 363 363 } 364 364 … … 447 447 rv = call_filter(zcrypt, argv, owl_zwrite_get_message(z), &cryptmsg, &status); 448 448 449 owl_free(zcrypt);449 g_free(zcrypt); 450 450 451 451 if (rv || status) { 452 if(cryptmsg) owl_free(cryptmsg);453 owl_free(old_msg);452 if(cryptmsg) g_free(cryptmsg); 453 g_free(old_msg); 454 454 owl_function_error("Error in zcrypt, possibly no key found. Message not sent."); 455 455 owl_function_beep(); … … 476 476 477 477 /* free the zwrite */ 478 owl_free(cryptmsg);478 g_free(cryptmsg); 479 479 } 480 480 … … 512 512 } 513 513 514 owl_free(format_msg);514 g_free(format_msg); 515 515 } 516 516 … … 540 540 owl_function_error("Could not create AIM message"); 541 541 } 542 owl_free(format_msg);542 g_free(format_msg); 543 543 } 544 544 … … 871 871 path = owl_util_makepath(file); 872 872 ret=owl_zephyr_loadsubs(path, 1); 873 owl_free(path);873 g_free(path); 874 874 } 875 875 … … 993 993 /* execute the commands in shutdown */ 994 994 ret = owl_perlconfig_execute("BarnOwl::Hooks::_shutdown();"); 995 if (ret) owl_free(ret);995 if (ret) g_free(ret); 996 996 997 997 /* signal our child process, if any */ … … 1327 1327 while (owl_getline(&s, file)) 1328 1328 owl_fmtext_append_normal(&fm, s); 1329 owl_free(s);1329 g_free(s); 1330 1330 1331 1331 owl_function_popless_fmtext(&fm); … … 1466 1466 strcat(tmpbuff, "..."); 1467 1467 } 1468 owl_free(ptr);1468 g_free(ptr); 1469 1469 1470 1470 for (j=0; j<strlen(tmpbuff); j++) { … … 1610 1610 } 1611 1611 1612 owl_free(buff);1612 g_free(buff); 1613 1613 } 1614 1614 … … 1883 1883 owl_function_start_command(buff); 1884 1884 } 1885 owl_free(buff);1885 g_free(buff); 1886 1886 } 1887 1887 } … … 1900 1900 result = owl_zephyr_zlocate(ptr, auth); 1901 1901 owl_fmtext_append_normal(&fm, result); 1902 owl_free(result);1903 owl_free(ptr);1902 g_free(result); 1903 g_free(ptr); 1904 1904 } 1905 1905 … … 1916 1916 if (rv) { 1917 1917 owl_function_makemsg("%s", rv); 1918 owl_free(rv);1918 g_free(rv); 1919 1919 } 1920 1920 } … … 2001 2001 2002 2002 if (type == OWL_OUTPUT_RETURN) { 2003 owl_free(newbuff);2003 g_free(newbuff); 2004 2004 return out; 2005 2005 } else if (type == OWL_OUTPUT_ADMINMSG) { 2006 2006 owl_function_adminmsg(buff, out); 2007 2007 } 2008 owl_free(out);2009 } 2010 owl_free(newbuff);2008 g_free(out); 2009 } 2010 g_free(newbuff); 2011 2011 return NULL; 2012 2012 } … … 2038 2038 return perlout; 2039 2039 } 2040 owl_free(perlout);2040 g_free(perlout); 2041 2041 } 2042 2042 return NULL; … … 2247 2247 buff = owl_sprintf("%s: %s", owl_filter_get_name(f), tmp); 2248 2248 owl_function_popless_text(buff); 2249 owl_free(buff);2250 owl_free(tmp);2249 g_free(buff); 2250 g_free(tmp); 2251 2251 } 2252 2252 … … 2272 2272 tmp = owl_filter_print(f); 2273 2273 owl_fmtext_append_normal(&fm, tmp); 2274 owl_free(tmp);2274 g_free(tmp); 2275 2275 } 2276 2276 owl_function_popless_fmtext(&fm); … … 2313 2313 char *temp = g_utf8_strdown(filtname, -1); 2314 2314 if (temp) { 2315 owl_free(filtname);2315 g_free(filtname); 2316 2316 filtname = temp; 2317 2317 } … … 2341 2341 tmpinstance); 2342 2342 } 2343 owl_free(tmpclass);2344 owl_free(tmpinstance);2343 g_free(tmpclass); 2344 g_free(tmpinstance); 2345 2345 2346 2346 f = owl_filter_new_fromstring(filtname, buf->str); … … 2349 2349 /* Couldn't make a filter for some reason. Return NULL. */ 2350 2350 owl_function_error("Error creating filter '%s'", filtname); 2351 owl_free(filtname);2351 g_free(filtname); 2352 2352 filtname = NULL; 2353 2353 goto done; … … 2358 2358 2359 2359 done: 2360 owl_free(class);2360 g_free(class); 2361 2361 if (instance) { 2362 owl_free(instance);2362 g_free(instance); 2363 2363 } 2364 2364 return(filtname); … … 2380 2380 shortuser = short_zuser(longuser); 2381 2381 filtname = owl_sprintf("user-%s", shortuser); 2382 owl_free(shortuser);2382 g_free(shortuser); 2383 2383 2384 2384 /* if it already exists then go with it. This lets users override */ … … 2394 2394 "recipient ^%q$ ) ) ) or ( ( class ^login$ ) and ( sender ^%q$ ) )", 2395 2395 esclonguser, esclonguser, esclonguser); 2396 owl_free(esclonguser);2396 g_free(esclonguser); 2397 2397 2398 2398 f = owl_filter_new_fromstring(filtname, argbuff); 2399 owl_free(argbuff);2399 g_free(argbuff); 2400 2400 2401 2401 if (f == NULL) { 2402 2402 /* Couldn't make a filter for some reason. Return NULL. */ 2403 2403 owl_function_error("Error creating filter '%s'", filtname); 2404 owl_free(filtname);2404 g_free(filtname); 2405 2405 return NULL; 2406 2406 } … … 2439 2439 "( sender ^%2$s$ and recipient ^%1$s$ ) ) )", 2440 2440 escuser, owl_global_get_aim_screenname_for_filters(&g)); 2441 owl_free(escuser);2441 g_free(escuser); 2442 2442 2443 2443 f = owl_filter_new_fromstring(filtname, argbuff); 2444 owl_free(argbuff);2444 g_free(argbuff); 2445 2445 2446 2446 if (f == NULL) { 2447 2447 owl_function_error("Error creating filter '%s'", filtname); 2448 owl_free(filtname);2448 g_free(filtname); 2449 2449 return NULL; 2450 2450 } … … 2473 2473 2474 2474 argbuff = owl_string_build_quoted("type ^%q$", esctype); 2475 owl_free(esctype);2475 g_free(esctype); 2476 2476 2477 2477 f = owl_filter_new_fromstring(filtname, argbuff); 2478 owl_free(argbuff);2478 g_free(argbuff); 2479 2479 2480 2480 if (f == NULL) { 2481 2481 owl_function_error("Error creating filter '%s'", filtname); 2482 owl_free(filtname);2482 g_free(filtname); 2483 2483 return NULL; 2484 2484 } … … 2533 2533 owl_string_append_quoted_arg(buf, ccs_quoted); 2534 2534 g_string_append_c(buf, '$'); 2535 owl_free(ccs_quoted);2535 g_free(ccs_quoted); 2536 2536 2537 2537 f = owl_filter_new_fromstring(filtname, buf->str); … … 2540 2540 if (f == NULL) { 2541 2541 owl_function_error("Error creating filter '%s'", filtname); 2542 owl_free(filtname);2542 g_free(filtname); 2543 2543 return NULL; 2544 2544 } … … 2767 2767 owl_fmtext_append_normal(&fm,str1); 2768 2768 owl_fmtext_append_normal_color(&fm, str2, i, OWL_COLOR_DEFAULT); 2769 owl_free(str1);2770 owl_free(str2);2769 g_free(str1); 2770 g_free(str2); 2771 2771 } 2772 2772 … … 2790 2790 quoted=owl_text_quote(class, OWL_REGEX_QUOTECHARS, OWL_REGEX_QUOTEWITH); 2791 2791 owl_string_appendf_quoted(buf, "class ^(un)*%q(\\.d)*$", quoted); 2792 owl_free(quoted);2792 g_free(quoted); 2793 2793 } 2794 2794 if (!strcmp(inst, "*")) { … … 2797 2797 quoted=owl_text_quote(inst, OWL_REGEX_QUOTECHARS, OWL_REGEX_QUOTEWITH); 2798 2798 owl_string_appendf_quoted(buf, " and instance ^(un)*%q(\\.d)*$", quoted); 2799 owl_free(quoted);2799 g_free(quoted); 2800 2800 } 2801 2801 if (!strcmp(recip, "*")) { … … 2807 2807 quoted=owl_text_quote(recip, OWL_REGEX_QUOTECHARS, OWL_REGEX_QUOTEWITH); 2808 2808 owl_string_appendf_quoted(buf, " and recipient ^%q$", quoted); 2809 owl_free(quoted);2809 g_free(quoted); 2810 2810 } 2811 2811 … … 3054 3054 } 3055 3055 owl_fmtext_appendf_normal(&fm, " %-20.20s %-12.12s\n", owl_buddy_get_name(b), timestr); 3056 owl_free(timestr);3056 g_free(timestr); 3057 3057 } 3058 3058 } … … 3107 3107 location[x].tty, 3108 3108 location[x].time); 3109 owl_free(tmp);3109 g_free(tmp); 3110 3110 } 3111 3111 if (numlocs>=200) { … … 3115 3115 } 3116 3116 } 3117 owl_list_cleanup(&anyone, owl_free);3117 owl_list_cleanup(&anyone, g_free); 3118 3118 } 3119 3119 } … … 3125 3125 if (perlblist) { 3126 3126 owl_fmtext_append_ztext(&fm, perlblist); 3127 owl_free(perlblist);3127 g_free(perlblist); 3128 3128 } 3129 3129 } … … 3168 3168 if (plaintext) { 3169 3169 fputs(plaintext, file); 3170 owl_free(plaintext);3170 g_free(plaintext); 3171 3171 } 3172 3172 } … … 3291 3291 } 3292 3292 file = fopen(path, "r"); 3293 owl_free(path);3293 g_free(path); 3294 3294 if (!file) { 3295 3295 if (!fail_silent) { … … 3304 3304 } 3305 3305 3306 owl_free(s);3306 g_free(s); 3307 3307 fclose(file); 3308 3308 } … … 3377 3377 } 3378 3378 3379 owl_free(buff);3379 g_free(buff); 3380 3380 3381 3381 in_error--; … … 3396 3396 owl_errqueue_append_err(owl_global_get_errqueue(&g), buff); 3397 3397 3398 owl_free(buff);3399 owl_free(date);3398 g_free(buff); 3399 g_free(date); 3400 3400 } 3401 3401 … … 3446 3446 while (zaldptr) { 3447 3447 ZFreeALD(zaldptr->data); 3448 owl_free(zaldptr->data);3448 g_free(zaldptr->data); 3449 3449 zaldptr = g_list_next(zaldptr); 3450 3450 } … … 3461 3461 *zaldlist = g_list_append(*zaldlist, zald); 3462 3462 } else { 3463 owl_free(zald);3464 } 3465 } 3466 3467 owl_list_cleanup(&anyone, owl_free);3463 g_free(zald); 3464 } 3465 } 3466 3467 owl_list_cleanup(&anyone, g_free); 3468 3468 #endif 3469 3469 }
Note: See TracChangeset
for help on using the changeset viewer.