Changeset ddbbcffa


Ignore:
Timestamp:
Feb 11, 2011, 4:31:42 PM (10 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master, 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)
Message:
Replace owl_free with g_free.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Reviewed-by: Karl Ramm <kcr@mit.edu>
Files:
36 edited

Legend:

Unmodified
Added
Removed
  • aim.c

    r96828e4 rddbbcffa  
    203203  buff=owl_sprintf("Logged in to AIM as %s", screenname);
    204204  owl_function_adminmsg("", buff);
    205   owl_free(buff);
     205  g_free(buff);
    206206
    207207  owl_function_debugmsg("Successful AIM login for %s", screenname);
     
    292292  ret=aim_im_sendch1_ext(owl_global_get_aimsess(&g), &args);
    293293
    294   owl_free(encoded);
     294  g_free(encoded);
    295295
    296296  return(ret);
     
    356356                        NULL, NULL, 0,
    357357                        "us-ascii", foo, len);
    358   owl_free(foo);
     358  g_free(foo);
    359359
    360360  /*
     
    10541054  if (args->icbmflags & AIM_IMFLAGS_AWAY) owl_message_set_attribute(m, "isauto", "");
    10551055  owl_global_messagequeue_addmsg(&g, m);
    1056   owl_free(stripmsg);
    1057   owl_free(wrapmsg);
    1058   owl_free(nz_screenname);
     1056  g_free(stripmsg);
     1057  g_free(wrapmsg);
     1058  g_free(nz_screenname);
    10591059
    10601060  return(1);
     
    10821082  }
    10831083
    1084   owl_free(realmsg);
     1084  g_free(realmsg);
    10851085
    10861086  return(1);
     
    11951195  owl_function_debugmsg("parse_oncoming sn: %s idle: %i", userinfo->sn, userinfo->idletime);
    11961196   
    1197   owl_free(nz_screenname);
     1197  g_free(nz_screenname);
    11981198 
    11991199  /*
     
    12271227  nz_screenname=owl_aim_normalize_screenname(userinfo->sn);
    12281228  owl_buddylist_offgoing(owl_global_get_buddylist(&g), nz_screenname);
    1229   owl_free(nz_screenname);
     1229  g_free(nz_screenname);
    12301230
    12311231  if (userinfo->present & AIM_USERINFO_PRESENT_IDLE) {
  • buddy.c

    ra038c2a3 rddbbcffa  
    6666void owl_buddy_cleanup(owl_buddy *b)
    6767{
    68   if (b->name) owl_free(b->name);
     68  if (b->name) g_free(b->name);
    6969}
    7070
     
    7272{
    7373  owl_buddy_cleanup(b);
    74   owl_free(b);
     74  g_free(b);
    7575}
  • cmd.c

    r96828e4 rddbbcffa  
    4444void owl_cmddict_namelist_cleanup(owl_list *l)
    4545{
    46   owl_list_cleanup(l, owl_free);
     46  owl_list_cleanup(l, g_free);
    4747}
    4848
     
    6060  owl_cmd * newcmd = g_new(owl_cmd, 1);
    6161  if(owl_cmd_create_from_template(newcmd, cmd) < 0) {
    62     owl_free(newcmd);
     62    g_free(newcmd);
    6363    return -1;
    6464  }
     
    9191  argv=owl_parseline(tmpbuff, &argc);
    9292  if (argc < 0) {
    93     owl_free(tmpbuff);
     93    g_free(tmpbuff);
    9494    owl_function_makemsg("Unbalanced quotes");
    9595    return NULL;
     
    9898  if (argc < 1) {
    9999    owl_parse_delete(argv, argc);
    100     owl_free(tmpbuff);
     100    g_free(tmpbuff);
    101101    return NULL;
    102102  }
     
    105105
    106106  owl_parse_delete(argv, argc);
    107   owl_free(tmpbuff);
     107  g_free(tmpbuff);
    108108  return retval;
    109109}
     
    153153void owl_cmd_cleanup(owl_cmd *cmd)
    154154{
    155   if (cmd->name) owl_free(cmd->name);
    156   if (cmd->summary) owl_free(cmd->summary);
    157   if (cmd->usage) owl_free(cmd->usage);
    158   if (cmd->description) owl_free(cmd->description);
    159   if (cmd->cmd_aliased_to) owl_free(cmd->cmd_aliased_to);
     155  if (cmd->name) g_free(cmd->name);
     156  if (cmd->summary) g_free(cmd->summary);
     157  if (cmd->usage) g_free(cmd->usage);
     158  if (cmd->description) g_free(cmd->description);
     159  if (cmd->cmd_aliased_to) g_free(cmd->cmd_aliased_to);
    160160  if (cmd->cmd_perl) owl_perlconfig_cmd_cleanup(cmd);
    161161}
     
    164164{
    165165  owl_cmd_cleanup(cmd);
    166   owl_free(cmd);
     166  g_free(cmd);
    167167}
    168168
     
    188188      newcmd = owl_sprintf("%s %s", cmd->cmd_aliased_to, cmdbuffargs);
    189189      rv = owl_function_command(newcmd);
    190       owl_free(newcmd);
     190      g_free(newcmd);
    191191    }
    192192    alias_recurse_depth--;
     
    280280    owl_fmtext_append_normal(fm, indent);
    281281    owl_fmtext_append_normal(fm, "\n");
    282     owl_free(indent);
     282    g_free(indent);
    283283  } else {
    284284    owl_fmtext_append_bold(fm, "\nSYNOPSIS\n");
     
    294294    owl_fmtext_append_normal(fm, indent);
    295295    owl_fmtext_append_normal(fm, "\n");
    296     owl_free(indent);
     296    g_free(indent);
    297297  }
    298298
  • commands.c

    r96828e4 rddbbcffa  
    12471247  filename=owl_util_makepath(argv[1]);
    12481248  owl_function_dump(filename);
    1249   owl_free(filename);
     1249  g_free(filename);
    12501250  return(NULL);
    12511251}
     
    12881288  }
    12891289  owl_function_nextmsg_full(filter, skip_deleted, last_if_none);
    1290   if (filter) owl_free(filter);
     1290  if (filter) g_free(filter);
    12911291  return(NULL);
    12921292}
     
    13181318  }
    13191319  owl_function_prevmsg_full(filter, skip_deleted, first_if_none);
    1320   if (filter) owl_free(filter);
     1320  if (filter) g_free(filter);
    13211321  return(NULL);
    13221322}
     
    13571357  if (filtname) {
    13581358    owl_function_change_currentview_filter(filtname);
    1359     owl_free(filtname);
     1359    g_free(filtname);
    13601360  }
    13611361
    13621362done:
    1363   owl_free(tmp_argv);
     1363  g_free(tmp_argv);
    13641364
    13651365  return NULL;
     
    16831683      } else if (newbuff[i] != ' ') {
    16841684        owl_function_makemsg("Invalid arguments to 'multi' command.");   
    1685         owl_free(newbuff);
     1685        g_free(newbuff);
    16861686        return NULL;
    16871687      }
     
    16911691  for (i = 0; commands[i] != NULL; i++) {
    16921692    if (lastrv) {
    1693       owl_free(lastrv);
     1693      g_free(lastrv);
    16941694    }
    16951695    lastrv = owl_function_command(commands[i]);
    16961696  }
    1697   owl_free(newbuff);
     1697  g_free(newbuff);
    16981698  g_strfreev(commands);
    16991699  return lastrv;
     
    20172017 err:
    20182018  g_string_free(recip, true);
    2019   owl_free(message);
     2019  g_free(message);
    20202020  return NULL;
    20212021}
     
    21042104      foo=owl_function_create_negative_filter(owl_view_get_filtname(owl_global_get_current_view(&g)));
    21052105      owl_function_change_currentview_filter(foo);
    2106       owl_free(foo);
     2106      g_free(foo);
    21072107      return(NULL);
    21082108    }
     
    21292129    owl_function_create_filter(argc, myargv);
    21302130    owl_function_change_currentview_filter("owl-dynamic");
    2131     owl_free(myargv);
     2131    g_free(myargv);
    21322132    return NULL;
    21332133  }
     
    22642264  if (filtname) {
    22652265    owl_function_change_currentview_filter(filtname);
    2266     owl_free(filtname);
     2266    g_free(filtname);
    22672267  }
    22682268  return NULL;
     
    22792279  longuser = long_zuser(argv[1]);
    22802280  filtname = owl_function_zuserfilt(longuser);
    2281   owl_free(longuser);
     2281  g_free(longuser);
    22822282  if (filtname) {
    22832283    owl_function_change_currentview_filter(filtname);
    2284     owl_free(filtname);
     2284    g_free(filtname);
    22852285  }
    22862286  return NULL;
     
    23832383  if (filtname) {
    23842384    (void) owl_function_color_filter(filtname, argv[2], (argc == 4 ? argv[3] : NULL));
    2385     owl_free(filtname);
     2385    g_free(filtname);
    23862386  }
    23872387  return NULL;
     
    24862486    text = owl_string_build_quoted("filter %q", argv[1]);
    24872487    owl_function_punt(text, unpunt);
    2488     owl_free(text);
     2488    g_free(text);
    24892489  } else {
    24902490    owl_function_punt(skiptokens(buff, 1), unpunt);
     
    25762576  if (argc==2) {
    25772577    owl_editwin *e = owl_function_start_password("AIM Password: ");
    2578     owl_editwin_set_cbdata(e, owl_strdup(argv[1]), owl_free);
     2578    owl_editwin_set_cbdata(e, owl_strdup(argv[1]), g_free);
    25792579    owl_editwin_set_callback(e, owl_callback_aimlogin);
    25802580    return(NULL);
  • context.c

    r96828e4 rddbbcffa  
    6969  if (ctx->cursor)
    7070    g_object_unref(ctx->cursor);
    71   owl_free(ctx->keymap);
     71  g_free(ctx->keymap);
    7272  if (ctx->delete_cb)
    7373    ctx->delete_cb(ctx);
    74   owl_free(ctx);
     74  g_free(ctx);
    7575}
  • dict.c

    r35b6eb9 rddbbcffa  
    121121  found = _owl_dict_find_pos(d, k, &pos);
    122122  if (!found) return(NULL);
    123   owl_free(d->els[pos].k);
     123  g_free(d->els[pos].k);
    124124  v = d->els[pos].v;
    125125  for (i=pos; i<d->size-1; i++) {
     
    136136
    137137  for (i=0; i<d->size; i++) {
    138     owl_free(d->els[i].k);
     138    g_free(d->els[i].k);
    139139    if (elefree) (elefree)(d->els[i].v);
    140140  }
    141   if (d->els) owl_free(d->els);
     141  if (d->els) g_free(d->els);
    142142}
    143143
  • editwin.c

    r35b6eb9 rddbbcffa  
    8484    g_object_unref(e->win);
    8585  }
    86   owl_free(e->buff);
     86  g_free(e->buff);
    8787  /* just in case someone forgot to clean up */
    8888  while (e->excursions) {
     
    9191  oe_destroy_cbdata(e);
    9292
    93   owl_free(e);
     93  g_free(e);
    9494}
    9595
     
    306306  }
    307307
    308   owl_free(e->buff);
     308  g_free(e->buff);
    309309  _owl_editwin_init(e, e->winlines, e->wincols, e->style, e->hist);
    310310
     
    320320
    321321  if (locktext)
    322     owl_free(locktext);
     322    g_free(locktext);
    323323
    324324  oe_set_index(e, lock);
     
    388388{
    389389  oe_restore_excursion(e, x);
    390   owl_free(x);
     390  g_free(x);
    391391}
    392392
     
    10731073
    10741074  if (p != NULL) {
    1075     owl_free(killbuf);
     1075    g_free(killbuf);
    10761076    memcpy(p, buf, len);
    10771077    p[len] = 0;
  • filter.c

    r96828e4 rddbbcffa  
    115115err:
    116116  owl_filterelement_cleanup(fe);
    117   owl_free(fe);
     117  g_free(fe);
    118118  return NULL;
    119119}
     
    153153  if(op1) {
    154154    owl_filterelement_cleanup(op1);
    155     owl_free(op1);
     155    g_free(op1);
    156156  }
    157157  return NULL;
     
    245245                       owl_filter_get_name(b));
    246246
    247   owl_free(buffa);
    248   owl_free(buffb);
     247  g_free(buffa);
     248  g_free(buffb);
    249249
    250250  return ret;
     
    263263  if (f->root) {
    264264    owl_filterelement_cleanup(f->root);
    265     owl_free(f->root);
     265    g_free(f->root);
    266266  }
    267267  if (f->name)
    268     owl_free(f->name);
    269   owl_free(f);
    270 }
     268    g_free(f->name);
     269  g_free(f);
     270}
  • filterelement.c

    rd222c44 rddbbcffa  
    9494      tf=1;
    9595    }
    96     owl_free(perlrv);
     96    g_free(perlrv);
    9797  }
    9898  return tf;
     
    216216  fe->field=owl_strdup(field);
    217217  if(owl_regex_create(&(fe->re), re)) {
    218     owl_free(fe->field);
     218    g_free(fe->field);
    219219    fe->field = NULL;
    220220    return (-1);
     
    325325void owl_filterelement_cleanup(owl_filterelement *fe)
    326326{
    327   if (fe->field) owl_free(fe->field);
     327  if (fe->field) g_free(fe->field);
    328328  if (fe->left) {
    329329    owl_filterelement_cleanup(fe->left);
    330     owl_free(fe->left);
     330    g_free(fe->left);
    331331  }
    332332  if (fe->right) {
    333333    owl_filterelement_cleanup(fe->right);
    334     owl_free(fe->right);
     334    g_free(fe->right);
    335335  }
    336336  owl_regex_cleanup(&(fe->re));
  • fmtext.c

    r96828e4 rddbbcffa  
    7373    return;
    7474  owl_fmtext_append_attr(f, buff, OWL_FMTEXT_ATTR_NONE, OWL_COLOR_DEFAULT, OWL_COLOR_DEFAULT);
    75   owl_free(buff);
     75  g_free(buff);
    7676}
    7777
     
    644644      buff[ptr-txtptr]='\0';
    645645      owl_fmtext_append_attr(f, buff, curattrs, curcolor, OWL_COLOR_DEFAULT);
    646       owl_free(buff);
     646      g_free(buff);
    647647
    648648      /* update pointer to point at the @ */
     
    685685        curattrs|=OWL_FMTEXT_ATTR_BOLD;
    686686        txtptr+=6;
    687         owl_free(buff);
     687        g_free(buff);
    688688        continue;
    689689      } else if (!strcasecmp(buff, "@b")) {
     
    694694        curattrs|=OWL_FMTEXT_ATTR_BOLD;
    695695        txtptr+=3;
    696         owl_free(buff);
     696        g_free(buff);
    697697        continue;
    698698      } else if (!strcasecmp(buff, "@i")) {
     
    703703        curattrs|=OWL_FMTEXT_ATTR_UNDERLINE;
    704704        txtptr+=3;
    705         owl_free(buff);
     705        g_free(buff);
    706706        continue;
    707707      } else if (!strcasecmp(buff, "@italic")) {
     
    712712        curattrs|=OWL_FMTEXT_ATTR_UNDERLINE;
    713713        txtptr+=8;
    714         owl_free(buff);
     714        g_free(buff);
    715715        continue;
    716716      } else if (!strcasecmp(buff, "@")) {
     
    720720        stacksize++;
    721721        txtptr+=2;
    722         owl_free(buff);
     722        g_free(buff);
    723723        continue;
    724724
     
    728728                 && owl_global_get_hascolors(&g)
    729729                 && owl_global_is_colorztext(&g)) {
    730         owl_free(buff);
     730        g_free(buff);
    731731        txtptr+=7;
    732732        tmpptr=strpbrk(txtptr, "@{[<()>]}");
     
    746746          if (curcolor == OWL_COLOR_INVALID)
    747747              curcolor = OWL_COLOR_DEFAULT;
    748           owl_free(buff);
     748          g_free(buff);
    749749          txtptr=tmpptr+1;
    750750          continue;
     
    769769      buff[ptr-txtptr]='\0';
    770770      owl_fmtext_append_attr(f, buff, curattrs, curcolor, OWL_COLOR_DEFAULT);
    771       owl_free(buff);
     771      g_free(buff);
    772772
    773773      /* now deal with the closer */
     
    780780        buff[1]='\0';
    781781        owl_fmtext_append_attr(f, buff, curattrs, curcolor, OWL_COLOR_DEFAULT);
    782         owl_free(buff);
     782        g_free(buff);
    783783        txtptr++;
    784784        continue;
     
    806806        buff[1]='\0';
    807807        owl_fmtext_append_attr(f, buff, curattrs, curcolor, OWL_COLOR_DEFAULT);
    808         owl_free(buff);
     808        g_free(buff);
    809809        txtptr++;
    810810        continue;
     
    816816      buff[ptr-txtptr+1]='\0';
    817817      owl_fmtext_append_attr(f, buff, curattrs, curcolor, OWL_COLOR_DEFAULT);
    818       owl_free(buff);
     818      g_free(buff);
    819819      txtptr=ptr+1;
    820820      continue;
     
    840840      if (text) {
    841841        owl_fmtext_append_normal(f, text);
    842         owl_free(text);
     842        g_free(text);
    843843      }
    844844    } else if (elem) {
  • functions.c

    r96828e4 rddbbcffa  
    3232  char *rv;
    3333  rv=owl_function_command(cmdbuff);
    34   if (rv) owl_free(rv);
     34  if (rv) g_free(rv);
    3535}
    3636
     
    8989  owl_fmtext_append_normal(&fm, "\n");
    9090  owl_function_popless_fmtext(&fm);
    91   owl_list_cleanup(&l, owl_free);
     91  owl_list_cleanup(&l, g_free);
    9292  owl_fmtext_cleanup(&fm);
    9393}
     
    100100                          (int)(timer->time - time(NULL)));
    101101  owl_fmtext_append_normal(fm, str);
    102   owl_free(str);
     102  g_free(str);
    103103  if (timer->interval) {
    104104    str = owl_sprintf(", repeat every %d seconds", timer->interval);
    105105    owl_fmtext_append_normal(fm, str);
    106     owl_free(str);
     106    g_free(str);
    107107  }
    108108  owl_fmtext_append_normal(fm, "\n");
     
    218218            char *result = owl_sprintf("%s%s", message, perlquickstart);
    219219            owl_function_adminmsg("BarnOwl Quickstart", result);
    220             owl_free(result);
    221             owl_free(perlquickstart);
     220            g_free(result);
     221            g_free(perlquickstart);
    222222            return;
    223223        }
     
    313313  s = owl_sprintf("----> %s\n", line);
    314314  owl_editwin_set_locktext(e, s);
    315   owl_free(s);
     315  g_free(s);
    316316
    317317  owl_editwin_set_cbdata(e, data, cleanup);
     
    359359                              &owl_callback_aimwrite,
    360360                              owl_strdup(to),
    361                               owl_free);
    362   owl_free(line);
     361                              g_free);
     362  g_free(line);
    363363}
    364364
     
    447447  rv = call_filter(zcrypt, argv, owl_zwrite_get_message(z), &cryptmsg, &status);
    448448
    449   owl_free(zcrypt);
     449  g_free(zcrypt);
    450450
    451451  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);
    454454    owl_function_error("Error in zcrypt, possibly no key found.  Message not sent.");
    455455    owl_function_beep();
     
    476476
    477477  /* free the zwrite */
    478   owl_free(cryptmsg);
     478  g_free(cryptmsg);
    479479}
    480480
     
    512512  }
    513513
    514   owl_free(format_msg);
     514  g_free(format_msg);
    515515}
    516516
     
    540540    owl_function_error("Could not create AIM message");
    541541  }
    542   owl_free(format_msg);
     542  g_free(format_msg);
    543543}
    544544
     
    871871    path = owl_util_makepath(file);
    872872    ret=owl_zephyr_loadsubs(path, 1);
    873     owl_free(path);
     873    g_free(path);
    874874  }
    875875
     
    993993  /* execute the commands in shutdown */
    994994  ret = owl_perlconfig_execute("BarnOwl::Hooks::_shutdown();");
    995   if (ret) owl_free(ret);
     995  if (ret) g_free(ret);
    996996
    997997  /* signal our child process, if any */
     
    13271327  while (owl_getline(&s, file))
    13281328    owl_fmtext_append_normal(&fm, s);
    1329   owl_free(s);
     1329  g_free(s);
    13301330
    13311331  owl_function_popless_fmtext(&fm);
     
    14661466            strcat(tmpbuff, "...");
    14671467          }
    1468           owl_free(ptr);
     1468          g_free(ptr);
    14691469
    14701470          for (j=0; j<strlen(tmpbuff); j++) {
     
    16101610  }
    16111611           
    1612   owl_free(buff);
     1612  g_free(buff);
    16131613}
    16141614
     
    18831883      owl_function_start_command(buff);
    18841884    }
    1885     owl_free(buff);
     1885    g_free(buff);
    18861886  }
    18871887}
     
    19001900    result = owl_zephyr_zlocate(ptr, auth);
    19011901    owl_fmtext_append_normal(&fm, result);
    1902     owl_free(result);
    1903     owl_free(ptr);
     1902    g_free(result);
     1903    g_free(ptr);
    19041904  }
    19051905
     
    19161916   if (rv) {
    19171917    owl_function_makemsg("%s", rv);
    1918     owl_free(rv);
     1918    g_free(rv);
    19191919  }
    19201920}
     
    20012001   
    20022002    if (type == OWL_OUTPUT_RETURN) {
    2003       owl_free(newbuff);
     2003      g_free(newbuff);
    20042004      return out;
    20052005    } else if (type == OWL_OUTPUT_ADMINMSG) {
    20062006      owl_function_adminmsg(buff, out);
    20072007    }
    2008     owl_free(out);
    2009   }
    2010   owl_free(newbuff);
     2008    g_free(out);
     2009  }
     2010  g_free(newbuff);
    20112011  return NULL;
    20122012}
     
    20382038      return perlout;
    20392039    }
    2040     owl_free(perlout);
     2040    g_free(perlout);
    20412041  }
    20422042  return NULL;
     
    22472247  buff = owl_sprintf("%s: %s", owl_filter_get_name(f), tmp);
    22482248  owl_function_popless_text(buff);
    2249   owl_free(buff);
    2250   owl_free(tmp);
     2249  g_free(buff);
     2250  g_free(tmp);
    22512251}
    22522252
     
    22722272    tmp = owl_filter_print(f);
    22732273    owl_fmtext_append_normal(&fm, tmp);
    2274     owl_free(tmp);
     2274    g_free(tmp);
    22752275  }
    22762276  owl_function_popless_fmtext(&fm);
     
    23132313    char *temp = g_utf8_strdown(filtname, -1);
    23142314    if (temp) {
    2315       owl_free(filtname);
     2315      g_free(filtname);
    23162316      filtname = temp;
    23172317    }
     
    23412341                              tmpinstance);
    23422342  }
    2343   owl_free(tmpclass);
    2344   owl_free(tmpinstance);
     2343  g_free(tmpclass);
     2344  g_free(tmpinstance);
    23452345
    23462346  f = owl_filter_new_fromstring(filtname, buf->str);
     
    23492349    /* Couldn't make a filter for some reason. Return NULL. */
    23502350    owl_function_error("Error creating filter '%s'", filtname);
    2351     owl_free(filtname);
     2351    g_free(filtname);
    23522352    filtname = NULL;
    23532353    goto done;
     
    23582358
    23592359done:
    2360   owl_free(class);
     2360  g_free(class);
    23612361  if (instance) {
    2362     owl_free(instance);
     2362    g_free(instance);
    23632363  }
    23642364  return(filtname);
     
    23802380  shortuser = short_zuser(longuser);
    23812381  filtname = owl_sprintf("user-%s", shortuser);
    2382   owl_free(shortuser);
     2382  g_free(shortuser);
    23832383
    23842384  /* if it already exists then go with it.  This lets users override */
     
    23942394      "recipient ^%q$ ) ) ) or ( ( class ^login$ ) and ( sender ^%q$ ) )",
    23952395      esclonguser, esclonguser, esclonguser);
    2396   owl_free(esclonguser);
     2396  g_free(esclonguser);
    23972397
    23982398  f = owl_filter_new_fromstring(filtname, argbuff);
    2399   owl_free(argbuff);
     2399  g_free(argbuff);
    24002400
    24012401  if (f == NULL) {
    24022402    /* Couldn't make a filter for some reason. Return NULL. */
    24032403    owl_function_error("Error creating filter '%s'", filtname);
    2404     owl_free(filtname);
     2404    g_free(filtname);
    24052405    return NULL;
    24062406  }
     
    24392439      "( sender ^%2$s$ and recipient ^%1$s$ ) ) )",
    24402440      escuser, owl_global_get_aim_screenname_for_filters(&g));
    2441   owl_free(escuser);
     2441  g_free(escuser);
    24422442
    24432443  f = owl_filter_new_fromstring(filtname, argbuff);
    2444   owl_free(argbuff);
     2444  g_free(argbuff);
    24452445
    24462446  if (f == NULL) {
    24472447    owl_function_error("Error creating filter '%s'", filtname);
    2448     owl_free(filtname);
     2448    g_free(filtname);
    24492449    return NULL;
    24502450  }
     
    24732473
    24742474  argbuff = owl_string_build_quoted("type ^%q$", esctype);
    2475   owl_free(esctype);
     2475  g_free(esctype);
    24762476
    24772477  f = owl_filter_new_fromstring(filtname, argbuff);
    2478   owl_free(argbuff);
     2478  g_free(argbuff);
    24792479
    24802480  if (f == NULL) {
    24812481    owl_function_error("Error creating filter '%s'", filtname);
    2482     owl_free(filtname);
     2482    g_free(filtname);
    24832483    return NULL;
    24842484  }
     
    25332533  owl_string_append_quoted_arg(buf, ccs_quoted);
    25342534  g_string_append_c(buf, '$');
    2535   owl_free(ccs_quoted);
     2535  g_free(ccs_quoted);
    25362536
    25372537  f = owl_filter_new_fromstring(filtname, buf->str);
     
    25402540  if (f == NULL) {
    25412541    owl_function_error("Error creating filter '%s'", filtname);
    2542     owl_free(filtname);
     2542    g_free(filtname);
    25432543    return NULL;
    25442544  }
     
    27672767    owl_fmtext_append_normal(&fm,str1);
    27682768    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);
    27712771  }
    27722772 
     
    27902790    quoted=owl_text_quote(class, OWL_REGEX_QUOTECHARS, OWL_REGEX_QUOTEWITH);
    27912791    owl_string_appendf_quoted(buf, "class ^(un)*%q(\\.d)*$", quoted);
    2792     owl_free(quoted);
     2792    g_free(quoted);
    27932793  }
    27942794  if (!strcmp(inst, "*")) {
     
    27972797    quoted=owl_text_quote(inst, OWL_REGEX_QUOTECHARS, OWL_REGEX_QUOTEWITH);
    27982798    owl_string_appendf_quoted(buf, " and instance ^(un)*%q(\\.d)*$", quoted);
    2799     owl_free(quoted);
     2799    g_free(quoted);
    28002800  }
    28012801  if (!strcmp(recip, "*")) {
     
    28072807    quoted=owl_text_quote(recip, OWL_REGEX_QUOTECHARS, OWL_REGEX_QUOTEWITH);
    28082808    owl_string_appendf_quoted(buf, " and recipient ^%q$", quoted);
    2809     owl_free(quoted);
     2809    g_free(quoted);
    28102810  }
    28112811
     
    30543054      }
    30553055      owl_fmtext_appendf_normal(&fm, "  %-20.20s %-12.12s\n", owl_buddy_get_name(b), timestr);
    3056       owl_free(timestr);
     3056      g_free(timestr);
    30573057    }
    30583058  }
     
    31073107                                        location[x].tty,
    31083108                                        location[x].time);
    3109               owl_free(tmp);
     3109              g_free(tmp);
    31103110            }
    31113111            if (numlocs>=200) {
     
    31153115        }
    31163116      }
    3117       owl_list_cleanup(&anyone, owl_free);
     3117      owl_list_cleanup(&anyone, g_free);
    31183118    }
    31193119  }
     
    31253125      if (perlblist) {
    31263126        owl_fmtext_append_ztext(&fm, perlblist);
    3127         owl_free(perlblist);
     3127        g_free(perlblist);
    31283128      }
    31293129    }
     
    31683168    if (plaintext) {
    31693169      fputs(plaintext, file);
    3170       owl_free(plaintext);
     3170      g_free(plaintext);
    31713171    }
    31723172  }
     
    32913291  }
    32923292  file = fopen(path, "r");
    3293   owl_free(path);
     3293  g_free(path);
    32943294  if (!file) {
    32953295    if (!fail_silent) {
     
    33043304  }
    33053305
    3306   owl_free(s);
     3306  g_free(s);
    33073307  fclose(file);
    33083308}
     
    33773377  }
    33783378
    3379   owl_free(buff);
     3379  g_free(buff);
    33803380
    33813381  in_error--;
     
    33963396  owl_errqueue_append_err(owl_global_get_errqueue(&g), buff);
    33973397
    3398   owl_free(buff);
    3399   owl_free(date);
     3398  g_free(buff);
     3399  g_free(date);
    34003400}
    34013401
     
    34463446  while (zaldptr) {
    34473447    ZFreeALD(zaldptr->data);
    3448     owl_free(zaldptr->data);
     3448    g_free(zaldptr->data);
    34493449    zaldptr = g_list_next(zaldptr);
    34503450  }
     
    34613461      *zaldlist = g_list_append(*zaldlist, zald);
    34623462    } 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);
    34683468#endif
    34693469}
  • global.c

    r96828e4 rddbbcffa  
    9696  cd = owl_sprintf("%s/%s", g->homedir, OWL_CONFIG_DIR);
    9797  owl_global_set_confdir(g, cd);
    98   owl_free(cd);
     98  g_free(cd);
    9999
    100100  owl_messagelist_create(&(g->msglist));
     
    379379 */
    380380void owl_global_set_confdir(owl_global *g, const char *cd) {
    381   owl_free(g->confdir);
     381  g_free(g->confdir);
    382382  g->confdir = owl_strdup(cd);
    383   owl_free(g->startupfile);
     383  g_free(g->startupfile);
    384384  g->startupfile = owl_sprintf("%s/startup", cd);
    385385}
     
    528528
    529529void owl_global_set_startupargs(owl_global *g, int argc, char **argv) {
    530   if (g->startupargs) owl_free(g->startupargs);
     530  if (g->startupargs) g_free(g->startupargs);
    531531  g->startupargs = g_strjoinv(" ", argv);
    532532}
     
    564564  e->g->filterlist = g_list_remove(e->g->filterlist, e->f);
    565565  owl_filter_delete(e->f);
    566   owl_free(e);
     566  g_free(e);
    567567}
    568568
     
    699699  char *sn_escaped;
    700700  g->aim_loggedin=1;
    701   if (g->aim_screenname) owl_free(g->aim_screenname);
    702   if (g->aim_screenname_for_filters) owl_free(g->aim_screenname_for_filters);
     701  if (g->aim_screenname) g_free(g->aim_screenname);
     702  if (g->aim_screenname_for_filters) g_free(g->aim_screenname_for_filters);
    703703  g->aim_screenname=owl_strdup(screenname);
    704704  sn_escaped = owl_text_quote(screenname, OWL_REGEX_QUOTECHARS, OWL_REGEX_QUOTEWITH);
    705705  g->aim_screenname_for_filters = owl_arg_quote(sn_escaped);
    706   owl_free(sn_escaped);
     706  g_free(sn_escaped);
    707707}
    708708
     
    967967    path = owl_sprintf("%s.%d", filename, getpid());
    968968    fd = open(path, O_CREAT|O_WRONLY|O_EXCL, 0600);
    969     owl_free(path);
     969    g_free(path);
    970970
    971971    if (fd >= 0)
    972972      g->debug_file = fdopen(fd, "a");
    973973
    974     owl_free(open_file);
     974    g_free(open_file);
    975975    open_file = owl_strdup(filename);
    976976  }
  • history.c

    r2afae56 rddbbcffa  
    5353  /* if partial is set, remove the first entry first */
    5454  if (h->partial) {
    55     owl_free(owl_list_get_element(&(h->hist), 0));
     55    g_free(owl_list_get_element(&(h->hist), 0));
    5656    owl_list_remove_element(&(h->hist), 0);
    5757  }
     
    6464  /* if we've reached the max history size, pop off the last element */
    6565  if (size>OWL_HISTORYSIZE) {
    66     owl_free(owl_list_get_element(&(h->hist), size-1));
     66    g_free(owl_list_get_element(&(h->hist), size-1));
    6767    owl_list_remove_element(&(h->hist), size-1);
    6868  }
  • keybinding.c

    r96828e4 rddbbcffa  
    5050    if (kb->keys[i] == ERR) {
    5151      g_strfreev(ktokens);
    52       owl_free(kb->keys);
     52      g_free(kb->keys);
    5353      return(-1);
    5454    }
     
    6262void owl_keybinding_cleanup(owl_keybinding *kb)
    6363{
    64   if (kb->keys) owl_free(kb->keys);
    65   if (kb->desc) owl_free(kb->desc);
    66   if (kb->command) owl_free(kb->command);
     64  if (kb->keys) g_free(kb->keys);
     65  if (kb->desc) g_free(kb->desc);
     66  if (kb->command) g_free(kb->command);
    6767}
    6868
     
    7171{
    7272  owl_keybinding_cleanup(kb);
    73   owl_free(kb);
     73  g_free(kb);
    7474}
    7575
  • keymap.c

    r96828e4 rddbbcffa  
    2222void owl_keymap_cleanup(owl_keymap *km)
    2323{
    24   owl_free(km->name);
    25   owl_free(km->desc);
     24  g_free(km->name);
     25  g_free(km->desc);
    2626  owl_list_cleanup(&km->bindings, (void (*)(void *))owl_keybinding_delete);
    2727}
     
    4040  if ((kb = g_new(owl_keybinding, 1)) == NULL) return(-1);
    4141  if (0 != owl_keybinding_init(kb, keyseq, command, function_fn, desc)) {
    42     owl_free(kb);
     42    g_free(kb);
    4343    return(-1);
    4444  }
     
    6565  if ((kb = g_new(owl_keybinding, 1)) == NULL) return(-1);
    6666  if (0 != owl_keybinding_make_keys(kb, keyseq)) {
    67     owl_free(kb);
     67    g_free(kb);
    6868    return(-1);
    6969  }
     
    225225void owl_keyhandler_keymap_namelist_cleanup(owl_list *l)
    226226{
    227   owl_list_cleanup(l, owl_free);
     227  owl_list_cleanup(l, g_free);
    228228}
    229229
  • list.c

    r35b6eb9 rddbbcffa  
    8686    }
    8787  }
    88   owl_free(l->list);
     88  g_free(l->list);
    8989}
  • logging.c

    r96828e4 rddbbcffa  
    7979    fprintf(file, "From: %s <%s>\n\n", owl_message_get_zsig(m), tmp);
    8080    fprintf(file, "%s\n\n", owl_message_get_body(m));
    81     owl_free(tmp);
     81    g_free(tmp);
    8282}
    8383
     
    142142      owl_log_append(m, filename);
    143143
    144       owl_free(temp);
    145       owl_free(cc->data);
     144      g_free(temp);
     145      g_free(cc->data);
    146146      cc = g_list_delete_link(cc, cc);
    147147    }
     
    156156    temp2 = g_utf8_strdown(temp,-1);
    157157    to = owl_sprintf("aim:%s", temp2);
    158     owl_free(temp2);
    159     owl_free(temp);
     158    g_free(temp2);
     159    g_free(temp);
    160160  } else {
    161161    to = owl_strdup("loopback");
     
    164164  snprintf(filename, MAXPATHLEN, "%s/%s", logpath, to);
    165165  owl_log_append(m, filename);
    166   owl_free(to);
     166  g_free(to);
    167167
    168168  snprintf(filename, MAXPATHLEN, "%s/all", logpath);
    169169  owl_log_append(m, filename);
    170   owl_free(logpath);
     170  g_free(logpath);
    171171}
    172172
     
    200200  if (!file) {
    201201    owl_function_error("Unable to open file for outgoing logging");
    202     owl_free(logpath);
    203     owl_free(tobuff);
     202    g_free(logpath);
     203    g_free(tobuff);
    204204    return;
    205205  }
     
    211211
    212212  snprintf(filename, MAXPATHLEN, "%s/all", logpath);
    213   owl_free(logpath);
     213  g_free(logpath);
    214214  file=fopen(filename, "a");
    215215  if (!file) {
    216216    owl_function_error("Unable to open file for outgoing logging");
    217     owl_free(tobuff);
     217    g_free(tobuff);
    218218    return;
    219219  }
     
    224224  fclose(file);
    225225
    226   owl_free(tobuff);
     226  g_free(tobuff);
    227227}
    228228
     
    270270    normalto = g_utf8_strdown(temp, -1);
    271271    from=frombuff=owl_sprintf("aim:%s", normalto);
    272     owl_free(normalto);
    273     owl_free(temp);
     272    g_free(normalto);
     273    g_free(temp);
    274274  } else if (owl_message_is_type_loopback(m)) {
    275275    from=frombuff=owl_strdup("loopback");
     
    302302      char* temp = g_utf8_strdown(frombuff, -1);
    303303      if (temp) {
    304         owl_free(frombuff);
     304        g_free(frombuff);
    305305        from = frombuff = temp;
    306306      }
     
    336336      }
    337337
    338       owl_free(temp);
    339       owl_free(cc->data);
     338      g_free(temp);
     339      g_free(cc->data);
    340340      cc = g_list_delete_link(cc, cc);
    341341    }
    342342  }
    343343
    344   owl_free(frombuff);
    345   owl_free(logpath);
    346 }
     344  g_free(frombuff);
     345  g_free(logpath);
     346}
  • message.c

    r96828e4 rddbbcffa  
    6868    p=owl_list_get_element(&(m->attributes), i);
    6969    if (owl_pair_get_key(p) == attrname) {
    70       owl_free(owl_pair_get_value(p));
     70      g_free(owl_pair_get_value(p));
    7171      pair = p;
    7272      break;
     
    134134    }
    135135    owl_fmtext_append_normal(fm, buff);
    136     owl_free(buff);
     136    g_free(buff);
    137137  }
    138138}
     
    611611      out = g_list_prepend(out, owl_strdup(user));
    612612    }
    613     owl_free(shortuser);
     613    g_free(shortuser);
    614614    user = strtok(NULL, " ");
    615615  }
    616616
    617   owl_free(recip);
    618   owl_free(cc);
     617  g_free(recip);
     618  g_free(cc);
    619619
    620620  return(out);
     
    749749      /* Collapse any identical entries */
    750750      while (cc->next && strcasecmp(cc->data, cc->next->data) == 0) {
    751         owl_free(cc->data);
     751        g_free(cc->data);
    752752        cc = g_list_delete_link(cc, cc);
    753753      }
     
    756756      g_string_append(recips, tmp);
    757757
    758       owl_free(tmp);
    759       owl_free(cc->data);
     758      g_free(tmp);
     759      g_free(cc->data);
    760760      cc = g_list_delete_link(cc, cc);
    761761
     
    793793 
    794794  /* save the time, we need to nuke the string saved by message_init */
    795   if (m->timestr) owl_free(m->timestr);
     795  if (m->timestr) g_free(m->timestr);
    796796  m->time=n->z_time.tv_sec;
    797797  m->timestr=owl_strdup(ctime(&(m->time)));
     
    821821      tmp=owl_zephyr_get_field(n, 1);
    822822      owl_message_set_attribute(m, "loginhost", tmp);
    823       owl_free(tmp);
     823      g_free(tmp);
    824824
    825825      tmp=owl_zephyr_get_field(n, 3);
    826826      owl_message_set_attribute(m, "logintty", tmp);
    827       owl_free(tmp);
     827      g_free(tmp);
    828828    }
    829829
     
    868868    tmp2=owl_util_stripnewlines(tmp);
    869869    owl_message_set_body(m, tmp2);
    870     owl_free(tmp2);
     870    g_free(tmp2);
    871871  } else {
    872872    owl_message_set_body(m, tmp);
    873873  }
    874   owl_free(tmp);
     874  g_free(tmp);
    875875
    876876  /* if zcrypt is enabled try to decrypt the message */
     
    891891
    892892    rv = call_filter(zcrypt, argv, owl_message_get_body(m), &out, &status);
    893     owl_free(zcrypt);
     893    g_free(zcrypt);
    894894
    895895    if(!rv && !status) {
     
    899899      }
    900900      owl_message_set_body(m, out);
    901       owl_free(out);
     901      g_free(out);
    902902    } else if(out) {
    903       owl_free(out);
     903      g_free(out);
    904904    }
    905905  }
     
    957957  owl_function_debugmsg("create_pseudo_login: host is %s", host ? host : "");
    958958  owl_message_set_hostname(m, host ? host : "");
    959   owl_free(longuser);
     959  g_free(longuser);
    960960}
    961961
     
    978978    owl_message_set_recipient(m,
    979979                              longzuser); /* only gets the first user, must fix */
    980     owl_free(longzuser);
     980    g_free(longzuser);
    981981  }
    982982  owl_message_set_opcode(m, owl_zwrite_get_opcode(z));
     
    987987  replyline = owl_zwrite_get_replyline(z);
    988988  owl_message_set_zwriteline(m, replyline);
    989   owl_free(replyline);
     989  g_free(replyline);
    990990
    991991  owl_message_set_body(m, body);
     
    10181018  }
    10191019#endif
    1020   if (m->timestr) owl_free(m->timestr);
     1020  if (m->timestr) g_free(m->timestr);
    10211021
    10221022  /* free all the attributes */
     
    10241024  for (i=0; i<j; i++) {
    10251025    p=owl_list_get_element(&(m->attributes), i);
    1026     owl_free(owl_pair_get_value(p));
    1027     owl_free(p);
     1026    g_free(owl_pair_get_value(p));
     1027    g_free(p);
    10281028  }
    10291029
     
    10361036{
    10371037  owl_message_cleanup(m);
    1038   owl_free(m);
    1039 }
     1038  g_free(m);
     1039}
  • msgwin.c

    r23b6c11 rddbbcffa  
    2929void owl_msgwin_set_text_nocopy(owl_msgwin *msgwin, char *msg)
    3030{
    31   owl_free(msgwin->msg);
     31  g_free(msgwin->msg);
    3232  msgwin->msg = msg;
    3333  owl_window_dirty(msgwin->window);
     
    3636void owl_msgwin_cleanup(owl_msgwin *msgwin)
    3737{
    38   owl_free(msgwin->msg);
     38  g_free(msgwin->msg);
    3939  msgwin->msg = NULL;
    4040  if (msgwin->window) {
  • owl.c

    rab9bf01 rddbbcffa  
    437437
    438438  owl_function_log_err(err);
    439   owl_free(err);
     439  g_free(err);
    440440}
    441441
     
    522522    char *tty = owl_util_get_default_tty();
    523523    owl_global_set_tty(&g, tty);
    524     owl_free(tty);
     524    g_free(tty);
    525525  }
    526526
     
    558558  owl_function_debugmsg("startup: executing perl startup, if applicable");
    559559  perlout = owl_perlconfig_execute("BarnOwl::Hooks::_startup();");
    560   if (perlout) owl_free(perlout);
     560  if (perlout) g_free(perlout);
    561561
    562562  /* welcome message */
  • perlconfig.c

    r96828e4 rddbbcffa  
    3131    char *escape = owl_escape_highbit(str);
    3232    owl_function_error("Internal error! Non-UTF-8 string encountered:\n%s", escape);
    33     owl_free(escape);
     33    g_free(escape);
    3434  }
    3535  return ret;
     
    6969    (void)hv_store(ret, key, strlen(key), to_sv(element), 0);
    7070  }
    71   owl_list_cleanup(&l, owl_free);
     71  owl_list_cleanup(&l, g_free);
    7272
    7373  return ret;
     
    106106      ptr=owl_zephyr_get_field_as_utf8(owl_message_get_notice(m), i+1);
    107107      av_push(av_zfields, owl_new_sv(ptr));
    108       owl_free(ptr);
     108      g_free(ptr);
    109109    }
    110110    (void)hv_store(h, "fields", strlen("fields"), newRV_noinc((SV*)av_zfields), 0);
     
    159159  }
    160160  hr = sv_bless(hr,stash);
    161   owl_free(utype);
    162   owl_free(blessas);
     161  g_free(utype);
     162  g_free(blessas);
    163163  return hr;
    164164}
     
    407407  av_unshift(inc, 1);
    408408  av_store(inc, 0, owl_new_sv(path));
    409   owl_free(path);
     409  g_free(path);
    410410
    411411  eval_pv("use BarnOwl;", FALSE);
     
    464464                                           :"BarnOwl::_receive_msg_legacy_wrap", m);
    465465  }
    466   if (ptr) owl_free(ptr);
     466  if (ptr) g_free(ptr);
    467467}
    468468
     
    475475                                           :"BarnOwl::Hooks::_new_msg", m);
    476476  }
    477   if (ptr) owl_free(ptr);
     477  if (ptr) g_free(ptr);
    478478}
    479479
  • perlglue.xs

    r96828e4 rddbbcffa  
    4949                        }
    5050                        rv = owl_function_command_argv(argv, items);
    51                         owl_free(argv);
     51                        g_free(argv);
    5252                }
    5353                RETVAL = rv;
     
    5656                RETVAL
    5757        CLEANUP:
    58                 if (rv) owl_free(rv);
     58                if (rv) g_free(rv);
    5959
    6060SV *
     
    113113                RETVAL
    114114        CLEANUP:
    115                 if (rv) owl_free(rv);
     115                if (rv) g_free(rv);
    116116
    117117const utf8 *
     
    128128                RETVAL
    129129        CLEANUP:
    130                 owl_free(rv);
     130                g_free(rv);
    131131
    132132const utf8 *
     
    140140                RETVAL
    141141    CLEANUP:
    142                 if (rv) owl_free(rv);
     142                if (rv) g_free(rv);
    143143
    144144void
     
    324324        CLEANUP:
    325325                if (rv)
    326                         owl_free(rv);
     326                        g_free(rv);
    327327
    328328void
     
    342342                RETVAL = owl_new_av(&fl, (SV*(*)(const void*))owl_new_sv);
    343343                sv_2mortal((SV*)RETVAL);
    344                 owl_list_cleanup(&fl, owl_free);
     344                owl_list_cleanup(&fl, g_free);
    345345        }
    346346        OUTPUT:
     
    361361                RETVAL
    362362        CLEANUP:
    363                 owl_list_cleanup(&l, owl_free);
     363                owl_list_cleanup(&l, g_free);
    364364
    365365
     
    378378                RETVAL
    379379        CLEANUP:
    380                 owl_list_cleanup(&l, owl_free);
     380                owl_list_cleanup(&l, g_free);
    381381
    382382
     
    396396                RETVAL
    397397        CLEANUP:
    398                 owl_list_cleanup(&l, owl_free);
     398                owl_list_cleanup(&l, g_free);
    399399
    400400void
     
    610610                RETVAL
    611611        CLEANUP:
    612                 owl_free(region);
     612                g_free(region);
    613613
    614614SV *
  • popexec.c

    r96828e4 rddbbcffa  
    140140    owl_viewwin_append_text(pe->vwin, buf);
    141141  }
    142   owl_free(buf);
     142  g_free(buf);
    143143 
    144144}
     
    179179  if (pe->refcount<=0) {
    180180    owl_function_debugmsg("doing free of %p", pe);
    181     owl_free(pe);
     181    g_free(pe);
    182182  }
    183183}
  • popwin.c

    r96828e4 rddbbcffa  
    9292  g_object_unref(pw->content);
    9393
    94   owl_free(pw);
     94  g_free(pw);
    9595}
    9696
  • regex.c

    r5cbc929 rddbbcffa  
    2828    regerror(ret, NULL, buff1, LINE);
    2929    owl_function_makemsg("Error in regular expression: %s", buff1);
    30     owl_free(re->string);
     30    g_free(re->string);
    3131    re->string=NULL;
    3232    return(-1);
     
    4242  quoted=owl_text_quote(string, OWL_REGEX_QUOTECHARS, OWL_REGEX_QUOTEWITH);
    4343  owl_regex_create(re, quoted);
    44   owl_free(quoted);
     44  g_free(quoted);
    4545  return(0);
    4646}
     
    8787{
    8888    if (re->string) {
    89         owl_free(re->string);
     89        g_free(re->string);
    9090        regfree(&(re->re));
    9191    }
  • select.c

    r96828e4 rddbbcffa  
    3838      t->destroy(t);
    3939    }
    40     owl_free(t->name);
    41     owl_free(t);
     40    g_free(t->name);
     41    g_free(t);
    4242  }
    4343}
     
    128128        if (d->destroy)
    129129          d->destroy(d);
    130         owl_free(d);
     130        g_free(d);
    131131      }
    132132    }
     
    323323        a->destroy(a);
    324324      }
    325       owl_free(a);
     325      g_free(a);
    326326    }
    327327  }
  • style.c

    r4d24650 rddbbcffa  
    8080  owl_fmtext_cleanup(&with_tabs);
    8181
    82   owl_free(indent);
     82  g_free(indent);
    8383  if(sv)
    8484    SvREFCNT_dec(sv);
     
    9494void owl_style_cleanup(owl_style *s)
    9595{
    96   if (s->name) owl_free(s->name);
     96  if (s->name) g_free(s->name);
    9797  SvREFCNT_dec(s->perlobj);
    9898}
     
    101101{
    102102  owl_style_cleanup(s);
    103   owl_free(s);
     103  g_free(s);
    104104}
  • tester.c

    r65c753e rddbbcffa  
    134134      char *__value = (expr);                            \
    135135      FAIL_UNLESS((desc), !strcmp((expected), __value)); \
    136       owl_free(__value);                                 \
     136      g_free(__value);                                 \
    137137    } while (0)
    138138
     
    191191                  !strcmp(__argv[0], unquoted));        \
    192192      owl_parse_delete(__argv, __argc);                 \
    193       owl_free(__quoted);                               \
     193      g_free(__quoted);                         \
    194194    } while (0)
    195195
     
    258258  FAIL_UNLESS("get_keys result val",0==strcmp("c",owl_list_get_element(&l,2)));
    259259
    260   owl_list_cleanup(&l, owl_free);
     260  owl_list_cleanup(&l, g_free);
    261261  owl_dict_cleanup(&d, NULL);
    262262
     
    557557  FAIL_UNLESS("lines corrected truncated",
    558558              str && !strcmp(str, "1\n2\n3\n"));
    559   owl_free(str);
     559  g_free(str);
    560560
    561561  owl_fmtext_clear(&fm2);
     
    564564  FAIL_UNLESS("lines corrected truncated",
    565565              str && !strcmp(str, "1\n2\n3\n4\n"));
    566   owl_free(str);
     566  g_free(str);
    567567
    568568  /* Test owl_fmtext_truncate_cols. */
     
    579579                                  "56789\n"
    580580                                  "567890"));
    581   owl_free(str);
     581  g_free(str);
    582582
    583583  owl_fmtext_clear(&fm1);
     
    592592              str && !strcmp(str, "    123456"
    593593                                  "5678      "));
    594   owl_free(str);
     594  g_free(str);
    595595
    596596  /* Test owl_fmtext_expand_tabs. */
     
    605605              str && !strcmp(str, "12      1234567 1\n"
    606606                                  "12345678        1"));
    607   owl_free(str);
     607  g_free(str);
    608608
    609609  owl_fmtext_clear(&fm2);
     
    614614              str && !strcmp(str, "12     1234567 1\n"
    615615                                  "12345678       1"));
    616   owl_free(str);
     616  g_free(str);
    617617
    618618  /* Test owl_fmtext_search. */
     
    683683
    684684 out:
    685   owl_free(filtstr);
     685  g_free(filtstr);
    686686  return failed;
    687687}
     
    708708  if (filtname)
    709709    owl_global_remove_filter(&g, filtname);
    710   owl_free(filtname);
     710  g_free(filtname);
    711711  return failed;
    712712}
     
    732732  if (filtname)
    733733    owl_global_remove_filter(&g, filtname);
    734   owl_free(filtname);
     734  g_free(filtname);
    735735  return failed;
    736736}
  • text.c

    r35b6eb9 rddbbcffa  
    66
    77/* Returns a copy of 'in' with each line indented 'n'
    8  * characters. Result must be freed with owl_free. */
     8 * characters. Result must be freed with g_free. */
    99char *owl_text_indent(const char *in, int n)
    1010{
     
    107107
    108108  out2=owl_text_substitute(out, "&lt;", "<");
    109   owl_free(out);
     109  g_free(out);
    110110  out=owl_text_substitute(out2, "&gt;", ">");
    111   owl_free(out2);
     111  g_free(out2);
    112112  out2=owl_text_substitute(out, "&amp;", "&");
    113   owl_free(out);
     113  g_free(out);
    114114  out=owl_text_substitute(out2, "&quot;", "\"");
    115   owl_free(out2);
     115  g_free(out2);
    116116  out2=owl_text_substitute(out, "&nbsp;", " ");
    117   owl_free(out);
     117  g_free(out);
    118118  out=owl_text_substitute(out2, "&ensp;", "  ");
    119   owl_free(out2);
     119  g_free(out2);
    120120  out2=owl_text_substitute(out, "&emsp;", "   ");
    121   owl_free(out);
     121  g_free(out);
    122122  out=owl_text_substitute(out2, "&endash;", "--");
    123   owl_free(out2);
     123  g_free(out2);
    124124  out2=owl_text_substitute(out, "&emdash;", "---");
    125   owl_free(out);
     125  g_free(out);
    126126
    127127  return(out2);
  • util.c

    r35b6eb9 rddbbcffa  
    178178    /* TODO: when we move to requiring glib 2.22+, use
    179179     * g_ptr_array_new_with_free_func. */
    180     g_ptr_array_foreach(argv, (GFunc)owl_free, NULL);
     180    g_ptr_array_foreach(argv, (GFunc)g_free, NULL);
    181181    g_ptr_array_free(argv, true);
    182182    *argc = -1;
     
    262262
    263263/* Returns a quoted version of arg suitable for placing in a
    264  * command-line. Result should be freed with owl_free. */
     264 * command-line. Result should be freed with g_free. */
    265265char *owl_arg_quote(const char *arg)
    266266{
     
    293293
    294294/* hooks for doing memory allocation et. al. in owl */
    295 
    296 void owl_free(void *ptr)
    297 {
    298   g_free(ptr);
    299 }
    300295
    301296char *owl_strdup(const char *s1)
     
    372367    out=owl_strdup(tmp);
    373368    if (!strncmp(out, "/dev/", 5)) {
    374       owl_free(out);
     369      g_free(out);
    375370      out=owl_strdup(tmp+5);
    376371    }
     
    400395
    401396  out=owl_strdup(ptr1);
    402   owl_free(tmp);
     397  g_free(tmp);
    403398  return(out);
    404399}
     
    484479    owl_function_error("Cannot open %s (for writing): %s",
    485480                       actual_filename, strerror(errno));
    486     owl_free(newfile);
     481    g_free(newfile);
    487482    fclose(old);
    488483    free(actual_filename);
     
    495490    unlink(newfile);
    496491    fclose(new);
    497     owl_free(newfile);
     492    g_free(newfile);
    498493    fclose(old);
    499494    free(actual_filename);
     
    506501    else
    507502      numremoved++;
    508   owl_free(buf);
     503  g_free(buf);
    509504
    510505  fclose(new);
     
    516511    if (link(actual_filename, backupfile) != 0) {
    517512      owl_function_error("Cannot link %s: %s", backupfile, strerror(errno));
    518       owl_free(backupfile);
     513      g_free(backupfile);
    519514      unlink(newfile);
    520       owl_free(newfile);
     515      g_free(newfile);
    521516      return -1;
    522517    }
    523     owl_free(backupfile);
     518    g_free(backupfile);
    524519  }
    525520
     
    531526
    532527  unlink(newfile);
    533   owl_free(newfile);
     528  g_free(newfile);
    534529
    535530  g_free(actual_filename);
  • variable.c

    r96828e4 rddbbcffa  
    559559
    560560void owl_variable_update(owl_variable *var, const char *summary, const char *desc) {
    561   if(var->summary) owl_free(var->summary);
     561  if(var->summary) g_free(var->summary);
    562562  var->summary = owl_strdup(summary);
    563   if(var->description) owl_free(var->description);
     563  if(var->description) g_free(var->description);
    564564  var->description = owl_strdup(desc);
    565565}
     
    569569  if(old) {
    570570    owl_variable_update(old, summ, desc);
    571     if(old->pval_default) owl_free(old->pval_default);
     571    if(old->pval_default) g_free(old->pval_default);
    572572    old->pval_default = owl_strdup(initval);
    573573  } else {
     
    639639void owl_variable_dict_namelist_cleanup(owl_list *l)
    640640{
    641   owl_list_cleanup(l, owl_free);
     641  owl_list_cleanup(l, g_free);
    642642}
    643643
     
    645645{
    646646  if (v->delete_fn) v->delete_fn(v);
    647   owl_free(v->name);
    648   owl_free(v->summary);
    649   owl_free(v->description);
    650   owl_free(v);
     647  g_free(v->name);
     648  g_free(v->summary);
     649  g_free(v->description);
     650  g_free(v);
    651651}
    652652
     
    869869void owl_variable_delete_default(owl_variable *v)
    870870{
    871   if (v->val) owl_free(v->val);
     871  if (v->val) g_free(v->val);
    872872}
    873873
     
    10081008    if (!v->validate_fn(v, newval)) return(-1);
    10091009  }
    1010   if (v->val) owl_free(v->val);
     1010  if (v->val) g_free(v->val);
    10111011  v->val = owl_strdup(newval);
    10121012  return(0);
  • view.c

    r94b0b1d rddbbcffa  
    160160{
    161161  owl_list_cleanup(&v->ml.list, NULL);
    162   if (v->name) owl_free(v->name);
     162  if (v->name) g_free(v->name);
    163163}
  • viewwin.c

    r96828e4 rddbbcffa  
    4444      owl_fmtext_append_normal(&(v->fmtext), "\n");
    4545  }
    46   owl_free(text);
     46  g_free(text);
    4747  v->textlines=owl_fmtext_num_lines(&(v->fmtext));
    4848  v->topline=0;
     
    204204  owl_global_push_context_obj(&g, ctx);
    205205  owl_editwin_set_callback(tw, owl_viewwin_callback_search);
    206   owl_editwin_set_cbdata(tw, data, owl_free);
     206  owl_editwin_set_cbdata(tw, data, g_free);
    207207  /* We aren't saving tw, so release the reference we were given. */
    208208  owl_editwin_unref(tw);
     
    424424  g_object_unref(v->status);
    425425  owl_fmtext_cleanup(&(v->fmtext));
    426   owl_free(v);
    427 }
     426  g_free(v);
     427}
  • zbuddylist.c

    rb258c51 rddbbcffa  
    1616  for (i=0; i<j; i++) {
    1717    if (!strcasecmp(user, owl_list_get_element(&(zb->zusers), i))) {
    18       owl_free(user);
     18      g_free(user);
    1919      return(-1);
    2020    }
     
    3636    if (!strcasecmp(user, ptr)) {
    3737      owl_list_remove_element(&(zb->zusers), i);
    38       owl_free(ptr);
    39       owl_free(user);
     38      g_free(ptr);
     39      g_free(user);
    4040      return(0);
    4141    }
    4242  }
    43   owl_free(user);
     43  g_free(user);
    4444  return(-1);
    4545}
     
    5555  for (i=0; i<j; i++) {
    5656    if (!strcasecmp(user, owl_list_get_element(&(zb->zusers), i))) {
    57       owl_free(user);
     57      g_free(user);
    5858      return(1);
    5959    }
    6060  }
    61   owl_free(user);
     61  g_free(user);
    6262  return(0);
    6363}
  • zephyr.c

    r35b6eb9 rddbbcffa  
    112112    owl_zephyr_loadsubs_helper(subs->subs, subs->nsubs);
    113113    deferred_subs = g_list_delete_link(deferred_subs, deferred_subs);
    114     owl_free(subs);
     114    g_free(subs);
    115115  }
    116116
     
    127127
    128128  perl = owl_perlconfig_execute("BarnOwl::Zephyr::_zephyr_startup()");
    129   owl_free(perl);
     129  g_free(perl);
    130130
    131131  owl_select_add_pre_select_action(owl_zephyr_pre_select_action, NULL, NULL);
     
    222222    /* free stuff */
    223223    for (i=0; i<count; i++) {
    224       owl_free(subs[i].zsub_class);
    225       owl_free(subs[i].zsub_classinst);
    226       owl_free(subs[i].zsub_recipient);
    227     }
    228 
    229     owl_free(subs);
     224      g_free(subs[i].zsub_class);
     225      g_free(subs[i].zsub_classinst);
     226      g_free(subs[i].zsub_recipient);
     227    }
     228
     229    g_free(subs);
    230230  } else {
    231231    owl_sub_list *s = g_new(owl_sub_list, 1);
     
    263263
    264264  if (stat(subsfile, &statbuff) != 0) {
    265     owl_free(subsfile);
     265    g_free(subsfile);
    266266    if (error_on_nofile == 1)
    267267      return -1;
     
    272272  count = 0;
    273273  file = fopen(subsfile, "r");
    274   owl_free(subsfile);
     274  g_free(subsfile);
    275275  if (!file)
    276276    return -1;
     
    304304    if (buffer[0] == '-') {
    305305      owl_function_zpunt(subs[count].zsub_class, subs[count].zsub_classinst, subs[count].zsub_recipient, 0);
    306       owl_free(subs[count].zsub_class);
    307       owl_free(subs[count].zsub_classinst);
    308       owl_free(subs[count].zsub_recipient);
     306      g_free(subs[count].zsub_class);
     307      g_free(subs[count].zsub_classinst);
     308      g_free(subs[count].zsub_recipient);
    309309    } else {
    310310      count++;
     
    313313  fclose(file);
    314314  if (buffer)
    315     owl_free(buffer);
     315    g_free(buffer);
    316316
    317317  return owl_zephyr_loadsubs_helper(subs, count);
     
    381381
    382382  if (stat(subsfile, &statbuff) == -1) {
    383     owl_free(subs);
    384     owl_free(subsfile);
     383    g_free(subs);
     384    g_free(subsfile);
    385385    return 0;
    386386  }
     
    389389  count = 0;
    390390  file = fopen(subsfile, "r");
    391   owl_free(subsfile);
     391  g_free(subsfile);
    392392  if (file) {
    393393    while (owl_getline_chomp(&buffer, file)) {
     
    411411  }
    412412  if (buffer)
    413     owl_free(buffer);
     413    g_free(buffer);
    414414
    415415  return owl_zephyr_loadsubs_helper(subs, count);
     
    530530    tmp = g_strndup(n->z_message + save, n->z_message_len - save);
    531531    out = owl_validate_or_convert(tmp);
    532     owl_free(tmp);
     532    g_free(tmp);
    533533    return out;
    534534  }
     
    589589
    590590    msg = owl_sprintf("%s service on %s %s\n%s", n->z_opcode, n->z_class_inst, field3, field4);
    591     owl_free(field3);
    592     owl_free(field4);
     591    g_free(field3);
     592    g_free(field4);
    593593    if (msg) {
    594594      return msg;
     
    607607   
    608608    msg = owl_sprintf("New transaction [%s] entered in %s\nFrom: %s (%s)\nSubject: %s", field1, field2, field3, field5, field4);
    609     owl_free(field1);
    610     owl_free(field2);
    611     owl_free(field3);
    612     owl_free(field4);
    613     owl_free(field5);
     609    g_free(field1);
     610    g_free(field2);
     611    g_free(field3);
     612    g_free(field4);
     613    g_free(field5);
    614614    if (msg) {
    615615      return msg;
     
    623623   
    624624    msg = owl_sprintf("MOIRA %s on %s: %s", n->z_class_inst, owl_message_get_hostname(m), field1);
    625     owl_free(field1);
     625    g_free(field1);
    626626    if (msg) {
    627627      return msg;
     
    702702 
    703703  /* free then check the return */
    704   owl_free(notice.z_message);
     704  g_free(notice.z_message);
    705705  ZFreeNotice(&notice);
    706706  if (ret!=ZERR_NONE) {
     
    755755          owl_function_makemsg("Message sent to %s on -c %s -i %s\n", tmp, retnotice->z_class, retnotice->z_class_inst);
    756756        }
    757         owl_free(tmp);
     757        g_free(tmp);
    758758      } else {
    759759        /* class / instance message */
     
    820820
    821821      owl_zwrite_cleanup(&zw);
    822       owl_free(tmp);
     822      g_free(tmp);
    823823    }
    824824  } else {
     
    886886    tmpbuff = owl_sprintf("zwrite -i %s %s", owl_message_get_instance(m), myuser);
    887887  }
    888   owl_free(myuser);
    889   owl_free(to);
     888  g_free(myuser);
     889  g_free(to);
    890890
    891891  z = owl_zwrite_new(tmpbuff);
     
    896896  mout=owl_function_make_outgoing_zephyr(z);
    897897  owl_global_messagequeue_addmsg(&g, mout);
    898   owl_free(tmpbuff);
     898  g_free(tmpbuff);
    899899  owl_zwrite_delete(z);
    900900#endif
     
    942942                          locations.tty ? locations.tty : "?",
    943943                          locations.time ? locations.time : "?");
    944       owl_free(result);
     944      g_free(result);
    945945      result = p;
    946946    }
    947947  }
    948   owl_free(myuser);
     948  g_free(myuser);
    949949
    950950  return result;
     
    974974    }
    975975    fclose(file);
    976     owl_free(s);
     976    g_free(s);
    977977  }
    978978
     
    988988  }
    989989
    990   owl_free(line);
     990  g_free(line);
    991991#endif
    992992}
     
    10091009    owl_function_error("No subscription present in %s", subsfile);
    10101010  }
    1011   owl_free(subsfile);
    1012   owl_free(line);
     1011  g_free(subsfile);
     1012  g_free(line);
    10131013#endif
    10141014}
     
    10781078  filename = owl_zephyr_dotfile(".anyone", NULL);
    10791079  file = fopen(filename, "a");
    1080   owl_free(filename);
     1080  g_free(filename);
    10811081  if (!file) {
    10821082    owl_function_error("Error opening zephyr buddy file for append");
     
    10931093  filename = owl_zephyr_dotfile(".anyone", NULL);
    10941094  owl_util_file_deleteline(filename, name, 0);
    1095   owl_free(filename);
     1095  g_free(filename);
    10961096}
    10971097
     
    11511151                              sub.zsub_recipient);
    11521152      g_string_prepend(buf, tmp);
    1153       owl_free(tmp);
     1153      g_free(tmp);
    11541154    }
    11551155  }
     
    12691269  if (!f) {
    12701270    owl_function_error("Error opening file %s: %s", ourfile, strerror(errno) ? strerror(errno) : "");
    1271     owl_free(ourfile);
     1271    g_free(ourfile);
    12721272    return -1;
    12731273  }
    1274   owl_free(ourfile);
     1274  g_free(ourfile);
    12751275
    12761276  while (owl_getline_chomp(&s, f)) {
     
    12911291    owl_list_append_element(in, long_zuser(s));
    12921292  }
    1293   owl_free(s);
     1293  g_free(s);
    12941294  fclose(f);
    12951295  return 0;
     
    13551355    }
    13561356    ZFreeALD(zald);
    1357     owl_free(zald);
     1357    g_free(zald);
    13581358  }
    13591359}
  • zwrite.c

    r96828e4 rddbbcffa  
    145145  if(msg) {
    146146    owl_zwrite_set_message(z, msg);
    147     owl_free(msg);
     147    g_free(msg);
    148148  }
    149149
     
    181181    }
    182182    send_ping(to, z->class, z->inst);
    183     owl_free(to);
     183    g_free(to);
    184184  }
    185185
     
    189189void owl_zwrite_set_message_raw(owl_zwrite *z, const char *msg)
    190190{
    191   if (z->message) owl_free(z->message);
     191  if (z->message) g_free(z->message);
    192192  z->message = owl_validate_utf8(msg);
    193193}
     
    199199  char *tmp = NULL, *tmp2;
    200200
    201   if (z->message) owl_free(z->message);
     201  if (z->message) g_free(z->message);
    202202
    203203  j=owl_list_get_size(&(z->recips));
     
    211211        toline = owl_sprintf( "%s%s ", toline, (const char *) owl_list_get_element(&(z->recips), i));
    212212      }
    213       owl_free(tmp);
     213      g_free(tmp);
    214214      tmp = NULL;
    215215    }
     
    217217    tmp2 = owl_text_expand_tabs(tmp);
    218218    z->message=owl_sprintf("%s\n%s", toline, tmp2);
    219     owl_free(toline);
    220     owl_free(tmp);
    221     owl_free(tmp2);
     219    g_free(toline);
     220    g_free(tmp);
     221    g_free(tmp2);
    222222  } else {
    223223    tmp=owl_validate_utf8(msg);
    224224    z->message=owl_text_expand_tabs(tmp);
    225     owl_free(tmp);
     225    g_free(tmp);
    226226  }
    227227}
     
    258258      if (ret != 0)
    259259        break;
    260       owl_free(to);
     260      g_free(to);
    261261      to = NULL;
    262262    }
     
    265265    ret = send_zephyr(z->opcode, z->zsig, z->class, z->inst, to, z->message);
    266266  }
    267   owl_free(to);
     267  g_free(to);
    268268  return ret;
    269269}
     
    301301void owl_zwrite_set_opcode(owl_zwrite *z, const char *opcode)
    302302{
    303   if (z->opcode) owl_free(z->opcode);
     303  if (z->opcode) g_free(z->opcode);
    304304  z->opcode=owl_validate_utf8(opcode);
    305305}
     
    318318void owl_zwrite_set_zsig(owl_zwrite *z, const char *zsig)
    319319{
    320   if(z->zsig) owl_free(z->zsig);
     320  if(z->zsig) g_free(z->zsig);
    321321  z->zsig = owl_strdup(zsig);
    322322}
     
    362362{
    363363  owl_zwrite_cleanup(z);
    364   owl_free(z);
     364  g_free(z);
    365365}
    366366
    367367void owl_zwrite_cleanup(owl_zwrite *z)
    368368{
    369   owl_list_cleanup(&(z->recips), &owl_free);
    370   if (z->cmd) owl_free(z->cmd);
    371   if (z->zwriteline) owl_free(z->zwriteline);
    372   if (z->class) owl_free(z->class);
    373   if (z->inst) owl_free(z->inst);
    374   if (z->opcode) owl_free(z->opcode);
    375   if (z->realm) owl_free(z->realm);
    376   if (z->message) owl_free(z->message);
    377   if (z->zsig) owl_free(z->zsig);
     369  owl_list_cleanup(&(z->recips), &g_free);
     370  if (z->cmd) g_free(z->cmd);
     371  if (z->zwriteline) g_free(z->zwriteline);
     372  if (z->class) g_free(z->class);
     373  if (z->inst) g_free(z->inst);
     374  if (z->opcode) g_free(z->opcode);
     375  if (z->realm) g_free(z->realm);
     376  if (z->message) g_free(z->message);
     377  if (z->zsig) g_free(z->zsig);
    378378}
    379379
     
    381381 * Returns a zwrite line suitable for replying, specifically the
    382382 * message field is stripped out. Result should be freed with
    383  * owl_free.
     383 * g_free.
    384384 */
    385385char *owl_zwrite_get_replyline(const owl_zwrite *z)
Note: See TracChangeset for help on using the changeset viewer.