Changeset ddbbcffa for zephyr.c


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>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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}
Note: See TracChangeset for help on using the changeset viewer.