Changeset 96828e4


Ignore:
Timestamp:
Feb 11, 2011, 4:31:33 PM (14 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master, release-1.10, release-1.8, release-1.9
Children:
35b6eb9
Parents:
9518a85
git-author:
Anders Kaseorg <andersk@mit.edu> (08/27/09 00:51:45)
git-committer:
Anders Kaseorg <andersk@mit.edu> (02/11/11 16:31:33)
Message:
Replace owl_malloc with g_new and g_new0.

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

Legend:

Unmodified
Added
Removed
  • aim.c

    rc6adf17 r96828e4  
    134134 
    135135  /* this will leak, I know and just don't care right now */
    136   priv=owl_malloc(sizeof(struct owlfaim_priv));
    137   memset(priv, 0, sizeof(struct owlfaim_priv));
     136  priv=g_new0(struct owlfaim_priv, 1);
    138137
    139138  priv->screenname = owl_strdup(screenname);
     
    435434
    436435  j=strlen(in);
    437   out=owl_malloc(j+30);
     436  out=g_new(char, j+30);
    438437  k=0;
    439438  for (i=0; i<j; i++) {
     
    10461045  wrapmsg=owl_text_wordwrap(stripmsg, 70);
    10471046  nz_screenname=owl_aim_normalize_screenname(userinfo->sn);
    1048   m=owl_malloc(sizeof(owl_message));
     1047  m=g_new(owl_message, 1);
    10491048  owl_message_create_aim(m,
    10501049                         nz_screenname,
  • buddylist.c

    r1c4b4ca r96828e4  
    1111{
    1212  owl_buddy *b;
    13   b=owl_malloc(sizeof(owl_buddy));
     13  b=g_new(owl_buddy, 1);
    1414 
    1515  owl_buddy_create(b, OWL_PROTOCOL_AIM, screenname);
     
    5252
    5353    /* if not, create the login message */
    54     m=owl_malloc(sizeof(owl_message));
     54    m=g_new(owl_message, 1);
    5555    owl_message_create_aim(m,
    5656                           screenname,
     
    7171
    7272  if (owl_buddylist_is_aim_buddy_loggedin(bl, screenname)) {
    73     m=owl_malloc(sizeof(owl_message));
     73    m=g_new(owl_message, 1);
    7474    owl_message_create_aim(m,
    7575                           screenname,
  • cmd.c

    r4d24650 r96828e4  
    5050int owl_cmddict_add_alias(owl_cmddict *cd, const char *alias_from, const char *alias_to) {
    5151  owl_cmd *cmd;
    52   cmd = owl_malloc(sizeof(owl_cmd));
     52  cmd = g_new(owl_cmd, 1);
    5353  owl_cmd_create_alias(cmd, alias_from, alias_to);
    5454  owl_perlconfig_new_command(cmd->name);
     
    5858
    5959int owl_cmddict_add_cmd(owl_cmddict *cd, const owl_cmd * cmd) {
    60   owl_cmd * newcmd = owl_malloc(sizeof(owl_cmd));
     60  owl_cmd * newcmd = g_new(owl_cmd, 1);
    6161  if(owl_cmd_create_from_template(newcmd, cmd) < 0) {
    6262    owl_free(newcmd);
  • commands.c

    rfba2a65 r96828e4  
    13281328  char opt;
    13291329  int instance = 0, related = 0, i;
    1330   const char **tmp_argv = owl_malloc(sizeof(char *) * argc);
     1330  const char **tmp_argv = g_new(const char *, argc);
    13311331
    13321332  static const struct option options[] = {
  • context.c

    rcb81570 r96828e4  
    1111  if (!(mode & OWL_CTX_MODE_BITS))
    1212    mode |= OWL_CTX_INTERACTIVE;
    13   c = owl_malloc(sizeof *c);
    14   memset(c, 0, sizeof(*c));
     13  c = g_new0(owl_context, 1);
    1514  c->mode = mode;
    1615  c->data = data;
  • dict.c

    rd537350 r96828e4  
    1717int owl_dict_create(owl_dict *d) {
    1818  d->size=0;
    19   d->els=owl_malloc(INITSIZE*sizeof(owl_dict_el));
     19  d->els=g_new(owl_dict_el, INITSIZE);
    2020  d->avail=INITSIZE;
    2121  if (d->els==NULL) return(-1);
  • editwin.c

    r5f8ec6b r96828e4  
    7272static owl_editwin *owl_editwin_allocate(void)
    7373{
    74   owl_editwin *e;
    75   e = owl_malloc(sizeof(owl_editwin));
    76   memset(e, 0, sizeof(*e));
     74  owl_editwin *e = g_new0(owl_editwin, 1);
    7775  e->refcount = 1;
    7876  return e;
     
    123121                              owl_history *hist)
    124122{
    125   e->buff=owl_malloc(INCR);
     123  e->buff=g_new(char, INCR);
    126124  e->buff[0]='\0';
    127125  e->bufflen=0;
     
    303301
    304302  if (lock > 0) {
    305     locktext = owl_malloc(lock+1);
     303    locktext = g_new(char, lock+1);
    306304    strncpy(locktext, e->buff, lock);
    307305    locktext[lock] = 0;
     
    382380owl_editwin_excursion *owl_editwin_begin_excursion(owl_editwin *e)
    383381{
    384   owl_editwin_excursion *x = owl_malloc(sizeof *x);
     382  owl_editwin_excursion *x = g_new(owl_editwin_excursion, 1);
    385383  oe_save_excursion(e, x);
    386384  return x;
     
    747745    return;
    748746
    749   tmp = owl_malloc((end - start) + 1);
     747  tmp = g_new(char, (end - start) + 1);
    750748  tmp[(end - start)] = 0;
    751749  memcpy(tmp, middle, end - middle);
     
    10721070  char *killbuf = owl_global_get_kill_buffer(&g);
    10731071
    1074   p = owl_malloc(len + 1);
     1072  p = g_new(char, len + 1);
    10751073
    10761074  if (p != NULL) {
     
    14081406  char *p;
    14091407 
    1410   p = owl_malloc(end - start + 1);
     1408  p = g_new(char, end - start + 1);
    14111409  memcpy(p, e->buff + start, end - start);
    14121410  p[end - start] = 0;
  • filter.c

    r75c7e8e r96828e4  
    1919  owl_filter *f;
    2020
    21   f = owl_malloc(sizeof(owl_filter));
     21  f = g_new(owl_filter, 1);
    2222
    2323  f->name=owl_strdup(name);
     
    7070  if(!argc) return NULL;
    7171
    72   fe = owl_malloc(sizeof(owl_filterelement));
     72  fe = g_new(owl_filterelement, 1);
    7373  owl_filterelement_create(fe);
    7474
     
    133133    op2 = owl_filter_parse_primitive_expression(argc-i-1, argv+i+1, &skip);
    134134    if(!op2) goto err;
    135     tmp = owl_malloc(sizeof(owl_filterelement));
     135    tmp = g_new(owl_filterelement, 1);
    136136    if(!strcasecmp(argv[i], "and")) {
    137137      owl_filterelement_create_and(tmp, op1, op2);
  • fmtext.c

    r099597c r96828e4  
    640640    } else if (ptr[0]=='@') {
    641641      /* add the text up to this point then deal with the stack */
    642       buff=owl_malloc(ptr-txtptr+20);
     642      buff=g_new(char, ptr-txtptr+20);
    643643      strncpy(buff, txtptr, ptr-txtptr);
    644644      buff[ptr-txtptr]='\0';
     
    675675      /* check what command we've got, push it on the stack, start
    676676         using it, and continue ... unless it's a color command */
    677       buff=owl_malloc(tmpptr-ptr+20);
     677      buff=g_new(char, tmpptr-ptr+20);
    678678      strncpy(buff, ptr, tmpptr-ptr);
    679679      buff[tmpptr-ptr]='\0';
     
    738738
    739739          /* grab the color name */
    740           buff=owl_malloc(tmpptr-txtptr+20);
     740          buff=g_new(char, tmpptr-txtptr+20);
    741741          strncpy(buff, txtptr, tmpptr-txtptr);
    742742          buff[tmpptr-txtptr]='\0';
     
    765765    } else if (ptr[0]=='}' || ptr[0]==']' || ptr[0]==')' || ptr[0]=='>') {
    766766      /* add the text up to this point first */
    767       buff=owl_malloc(ptr-txtptr+20);
     767      buff=g_new(char, ptr-txtptr+20);
    768768      strncpy(buff, txtptr, ptr-txtptr);
    769769      buff[ptr-txtptr]='\0';
     
    776776      /* first, if the stack is empty we must bail (just print and go) */
    777777      if (stacksize==0) {
    778         buff=owl_malloc(5);
     778        buff=g_new(char, 5);
    779779        buff[0]=ptr[0];
    780780        buff[1]='\0';
     
    802802      } else {
    803803        /* otherwise print and continue */
    804         buff=owl_malloc(5);
     804        buff=g_new(char, 5);
    805805        buff[0]=ptr[0];
    806806        buff[1]='\0';
     
    812812    } else {
    813813      /* we've found an unattached opener, print everything and move on */
    814       buff=owl_malloc(ptr-txtptr+20);
     814      buff=g_new(char, ptr-txtptr+20);
    815815      strncpy(buff, txtptr, ptr-txtptr+1);
    816816      buff[ptr-txtptr+1]='\0';
     
    864864  short i;
    865865  /* The test is <= because we allocate COLORS+1 entries. */
    866   cpmgr->pairs = owl_malloc((COLORS+1) * sizeof(short*));
     866  cpmgr->pairs = g_new(short *, COLORS + 1);
    867867  for(i = 0; i <= COLORS; i++) {
    868     cpmgr->pairs[i] = owl_malloc((COLORS+1) * sizeof(short));
     868    cpmgr->pairs[i] = g_new(short, COLORS + 1);
    869869  }
    870870  owl_fmtext_reset_colorpairs(cpmgr);
  • functions.c

    r9518a85 r96828e4  
    234234  owl_message *m;
    235235
    236   m=owl_malloc(sizeof(owl_message));
     236  m=g_new(owl_message, 1);
    237237  owl_message_create_admin(m, header, body);
    238238 
     
    257257
    258258  /* create the message */
    259   m=owl_malloc(sizeof(owl_message));
     259  m=g_new(owl_message, 1);
    260260  owl_message_create_from_zwrite(m, z, owl_zwrite_get_message(z));
    261261
     
    275275  if (!owl_global_is_aimloggedin(&g)) return(NULL);
    276276 
    277   m=owl_malloc(sizeof(owl_message));
     277  m=g_new(owl_message, 1);
    278278  owl_message_create_aim(m,
    279279                         owl_global_get_aim_screenname(&g),
     
    294294
    295295  /* create the message */
    296   m=owl_malloc(sizeof(owl_message));
     296  m=g_new(owl_message, 1);
    297297  owl_message_create_loopback(m, body);
    298298  owl_message_set_direction_out(m);
     
    553553  /* create a message and put it on the message queue.  This simulates
    554554   * an incoming message */
    555   min=owl_malloc(sizeof(owl_message));
     555  min=g_new(owl_message, 1);
    556556  mout=owl_function_make_outgoing_loopback(msg);
    557557
     
    34573457  for (i = 0; i < j; i++) {
    34583458    user = owl_list_get_element(&anyone, i);
    3459     zald = owl_malloc(sizeof(ZAsyncLocateData_t));
     3459    zald = g_new(ZAsyncLocateData_t, 1);
    34603460    if (ZRequestLocations(zstr(user), zald, UNACKED, ZAUTH) == ZERR_NONE) {
    34613461      *zaldlist = g_list_append(*zaldlist, zald);
  • global.c

    rd3941a0 r96828e4  
    568568
    569569void owl_global_add_filter(owl_global *g, owl_filter *f) {
    570   owl_global_filter_ent *e = owl_malloc(sizeof *e);
     570  owl_global_filter_ent *e = g_new(owl_global_filter_ent, 1);
    571571  e->g = g;
    572572  e->f = f;
  • keybinding.c

    rd275eb2 r96828e4  
    4545    return(-1);
    4646  }
    47   kb->keys = owl_malloc(nktokens*sizeof(int));
     47  kb->keys = g_new(int, nktokens);
    4848  for (i=0; i<nktokens; i++) {
    4949    kb->keys[i] = owl_keypress_fromstring(ktokens[i]);
  • keymap.c

    r44cc9ab r96828e4  
    3838  int i;
    3939
    40   if ((kb = owl_malloc(sizeof(owl_keybinding))) == NULL) return(-1);
     40  if ((kb = g_new(owl_keybinding, 1)) == NULL) return(-1);
    4141  if (0 != owl_keybinding_init(kb, keyseq, command, function_fn, desc)) {
    4242    owl_free(kb);
     
    6363  int i;
    6464
    65   if ((kb = owl_malloc(sizeof(owl_keybinding))) == NULL) return(-1);
     65  if ((kb = g_new(owl_keybinding, 1)) == NULL) return(-1);
    6666  if (0 != owl_keybinding_make_keys(kb, keyseq)) {
    6767    owl_free(kb);
     
    197197{
    198198  owl_keymap *km;
    199   km = owl_malloc(sizeof(owl_keymap));
     199  km = g_new(owl_keymap, 1);
    200200  if (!km) return NULL;
    201201  owl_keymap_init(km, name, desc, default_fn, prealways_fn, postalways_fn);
  • list.c

    r5e5f08f r96828e4  
    88{
    99  l->size=0;
    10   l->list=owl_malloc(INITSIZE*sizeof(void *));
     10  l->list=g_new(void *, INITSIZE);
    1111  l->avail=INITSIZE;
    1212  if (l->list==NULL) return(-1);
  • logging.c

    rc366cbd r96828e4  
    182182   * owl_log_shouldlog_message(void)
    183183   */
    184   m = owl_malloc(sizeof(owl_message));
     184  m = g_new(owl_message, 1);
    185185  owl_message_create_from_zwrite(m, zw, text);
    186186  if (!owl_log_shouldlog_message(m)) {
  • message.c

    r719119de r96828e4  
    7575
    7676  if(pair ==  NULL) {
    77     pair = owl_malloc(sizeof(owl_pair));
     77    pair = g_new(owl_pair, 1);
    7878    owl_pair_create(pair, attrname, NULL);
    7979    owl_list_append_element(&(m->attributes), pair);
  • perlconfig.c

    rc107129 r96828e4  
    193193  hash = (HV*)SvRV(msg);
    194194
    195   m = owl_malloc(sizeof(owl_message));
     195  m = g_new(owl_message, 1);
    196196  owl_message_init(m);
    197197
  • perlglue.xs

    r40382e0 r96828e4  
    4343                        rv = owl_function_command(cmd);
    4444                } else {
    45                         argv = owl_malloc((items + 1) * sizeof *argv);
     45                        argv = g_new(const char *, items + 1);
    4646                        argv[0] = cmd;
    4747                        for(i = 1; i < items; i++) {
     
    287287     CODE:
    288288        {
    289                 s = owl_malloc(sizeof(owl_style));
     289                s = g_new(owl_style, 1);
    290290                owl_style_create_perl(s, name, newSVsv(object));
    291291                owl_global_add_style(&g, s);
  • popexec.c

    r9eb38bb r96828e4  
    2222  }
    2323
    24   pe = owl_malloc(sizeof(owl_popexec));
     24  pe = g_new(owl_popexec, 1);
    2525  if (!pe) return NULL;
    2626  pe->winactive=0;
     
    126126  if (navail<=0) return;
    127127  if (navail>1024) { navail = 1024; }
    128   buf = owl_malloc(navail+1);
     128  buf = g_new(char, navail+1);
    129129  owl_function_debugmsg("about to read %d", navail);
    130130  bread = read(d->fd, buf, navail);
  • popwin.c

    r9b9efa2b r96828e4  
    33owl_popwin *owl_popwin_new(void)
    44{
    5   owl_popwin *pw = owl_malloc(sizeof(owl_popwin));
    6   memset(pw, 0, sizeof(*pw));
     5  owl_popwin *pw = g_new0(owl_popwin, 1);
    76
    87  pw->border = owl_window_new(NULL);
  • select.c

    ra409a9d r96828e4  
    1515owl_timer *owl_select_add_timer(const char* name, int after, int interval, void (*cb)(owl_timer *, void *), void (*destroy)(owl_timer*), void *data)
    1616{
    17   owl_timer *t = owl_malloc(sizeof(owl_timer));
     17  owl_timer *t = g_new(owl_timer, 1);
    1818  GList **timers = owl_global_get_timerlist(&g);
    1919
     
    159159const owl_io_dispatch *owl_select_add_io_dispatch(int fd, int mode, void (*cb)(const owl_io_dispatch *, void *), void (*destroy)(const owl_io_dispatch *), void *data)
    160160{
    161   owl_io_dispatch *d = owl_malloc(sizeof(owl_io_dispatch));
     161  owl_io_dispatch *d = g_new(owl_io_dispatch, 1);
    162162  owl_list *dl = owl_global_get_io_dispatch_list(&g);
    163163
     
    299299owl_ps_action *owl_select_add_pre_select_action(int (*cb)(owl_ps_action *, void *), void (*destroy)(owl_ps_action *), void *data)
    300300{
    301   owl_ps_action *a = owl_malloc(sizeof(owl_ps_action));
     301  owl_ps_action *a = g_new(owl_ps_action, 1);
    302302  owl_list *psa_list = owl_global_get_psa_list(&g);
    303303  a->needs_gc = 0;
  • text.c

    r4d24650 r96828e4  
    5353  char *out, *out2;
    5454
    55   out=owl_malloc(strlen(in)+30);
     55  out=g_new(char, strlen(in)+30);
    5656  strcpy(out, "");
    5757
     
    156156  }
    157157
    158   ret = owl_malloc(len + 1);
     158  ret = g_new(char, len + 1);
    159159
    160160  p = in;
     
    281281  tolen  = strlen(to);
    282282  fromlen  = strlen(from);
    283   out = owl_malloc(outlen);
     283  out = g_new(char, outlen);
    284284
    285285  while (in[inpos]) {
     
    335335      escape++;
    336336  }
    337   out = owl_malloc(in_len + quotestr_len*escape+1);
     337  out = g_new(char, in_len + quotestr_len*escape+1);
    338338  for (i=0; i<in_len; i++) {
    339339
  • util.c

    r6965867 r96828e4  
    4141  struct passwd *pw;
    4242
    43   out=owl_malloc(MAXPATHLEN+1);
     43  out=g_new(char, MAXPATHLEN+1);
    4444  out[0]='\0';
    4545  j=strlen(in);
     
    294294/* hooks for doing memory allocation et. al. in owl */
    295295
    296 void *owl_malloc(size_t size)
    297 {
    298   return(g_malloc(size));
    299 }
    300 
    301296void owl_free(void *ptr)
    302297{
     
    593588  if (g_utf8_validate(in, -1, NULL)) {
    594589    const char *s, *p;
    595     r = owl_malloc(strlen(in)+1);
     590    r = g_new(char, strlen(in)+1);
    596591    r[0] = '\0';
    597592    s = in;
     
    718713/* Read a line from fp, allocating memory to hold it, returning the number of
    719714 * byte read.  *s should either be NULL or a pointer to memory allocated with
    720  * owl_malloc; it will be owl_realloc'd as appropriate.  The caller must
     715 * g_malloc; it will be owl_realloc'd as appropriate.  The caller must
    721716 * eventually free it.  (This is roughly the interface of getline in the gnu
    722717 * libc).
  • variable.c

    rd275eb2 r96828e4  
    479479  if (owl_dict_create(vd)) return(-1);
    480480  for (var = variables_to_init; var->name != NULL; var++) {
    481     cur = owl_malloc(sizeof(owl_variable));
     481    cur = g_new(owl_variable, 1);
    482482    *cur = *var;
    483483    /* strdup all the strings so we can delete them consistently. */
     
    517517      if (!cur->delete_fn)
    518518        cur->delete_fn = owl_variable_delete_default;
    519       cur->val = owl_malloc(sizeof(int));
     519      cur->val = g_new(int, 1);
    520520      cur->set_fn(cur, &cur->ival_default);
    521521      break;
     
    533533      if (!cur->delete_fn)
    534534        cur->delete_fn = owl_variable_delete_default;
    535       cur->val = owl_malloc(sizeof(int));
     535      cur->val = g_new(int, 1);
    536536      cur->set_fn(cur, &cur->ival_default);
    537537      break;
     
    551551
    552552owl_variable * owl_variable_newvar(const char *name, const char *summary, const char * description) {
    553   owl_variable * var = owl_malloc(sizeof(owl_variable));
    554   memset(var, 0, sizeof(owl_variable));
     553  owl_variable * var = g_new0(owl_variable, 1);
    555554  var->name = owl_strdup(name);
    556555  var->summary = owl_strdup(summary);
     
    601600    var->get_tostring_fn = owl_variable_int_get_tostring_default;
    602601    var->delete_fn = owl_variable_delete_default;
    603     var->val = owl_malloc(sizeof(int));
     602    var->val = g_new(int, 1);
    604603    var->set_fn(var, &initval);
    605604    owl_variable_dict_add_variable(vd, var);
     
    622621    var->get_tostring_fn = owl_variable_bool_get_tostring_default;
    623622    var->delete_fn = owl_variable_delete_default;
    624     var->val = owl_malloc(sizeof(int));
     623    var->val = g_new(int, 1);
    625624    var->set_fn(var, &initval);
    626625    owl_variable_dict_add_variable(vd, var);
  • viewwin.c

    rcedbe9d r96828e4  
    1414owl_viewwin *owl_viewwin_new_text(owl_window *win, const char *text)
    1515{
    16   owl_viewwin *v = owl_malloc(sizeof(owl_viewwin));
    17   memset(v, 0, sizeof(*v));
     16  owl_viewwin *v = g_new0(owl_viewwin, 1);
    1817  owl_fmtext_init_null(&(v->fmtext));
    1918  if (text) {
     
    3837{
    3938  char *text;
    40   owl_viewwin *v = owl_malloc(sizeof(owl_viewwin));
    41   memset(v, 0, sizeof(*v));
     39  owl_viewwin *v = g_new0(owl_viewwin, 1);
    4240
    4341  owl_fmtext_copy(&(v->fmtext), fmtext);
     
    197195  owl_editwin_insert_string(tw, buffstart);
    198196
    199   data = owl_malloc(sizeof(owl_viewwin_search_data));
     197  data = g_new(owl_viewwin_search_data, 1);
    200198  data->v = v;
    201199  data->direction = direction;
  • zephyr.c

    rdf3a1f4 r96828e4  
    229229    owl_free(subs);
    230230  } else {
    231     owl_sub_list *s = owl_malloc(sizeof(owl_sub_list));
     231    owl_sub_list *s = g_new(owl_sub_list, 1);
    232232    s->subs = subs;
    233233    s->nsubs = count;
     
    259259  struct stat statbuff;
    260260
    261   subs = owl_malloc(sizeof(ZSubscription_t) * subSize);
     261  subs = g_new(ZSubscription_t, subSize);
    262262  subsfile = owl_zephyr_dotfile(".zephyr.subs", filename);
    263263
     
    333333  int count, ret;
    334334
    335   subs = owl_malloc(sizeof(ZSubscription_t) * subSize);
     335  subs = g_new(ZSubscription_t, subSize);
    336336  ZResetAuthentication();
    337337  count=0;
     
    377377  struct stat statbuff;
    378378
    379   subs = owl_malloc(numSubs * sizeof(ZSubscription_t));
     379  subs = g_new(ZSubscription_t, numSubs);
    380380  subsfile = owl_zephyr_dotfile(".anyone", filename);
    381381
     
    694694
    695695  notice.z_message_len=strlen(zsig)+1+strlen(message);
    696   notice.z_message=owl_malloc(notice.z_message_len+10);
     696  notice.z_message=g_new(char, notice.z_message_len+10);
    697697  strcpy(notice.z_message, zsig);
    698698  memcpy(notice.z_message+strlen(zsig)+1, message, strlen(message));
     
    13331333          if (ret == ZERR_NONE) {
    13341334            /* Send a PSEUDO LOGIN! */
    1335             m = owl_malloc(sizeof(owl_message));
     1335            m = g_new(owl_message, 1);
    13361336            owl_message_create_pseudo_zlogin(m, 0, zald->user,
    13371337                                             location.host,
     
    13461346        /* Send a PSEUDO LOGOUT! */
    13471347        if (notify) {
    1348           m = owl_malloc(sizeof(owl_message));
     1348          m = g_new(owl_message, 1);
    13491349          owl_message_create_pseudo_zlogin(m, 1, zald->user, "", "", "");
    13501350          owl_global_messagequeue_addmsg(&g, m);
     
    14211421
    14221422      /* create the new message */
    1423       m=owl_malloc(sizeof(owl_message));
     1423      m=g_new(owl_message, 1);
    14241424      owl_message_create_from_znotice(m, &notice);
    14251425
  • zwrite.c

    rc6b1782 r96828e4  
    77owl_zwrite *owl_zwrite_new(const char *line)
    88{
    9   owl_zwrite *z = owl_malloc(sizeof *z);
     9  owl_zwrite *z = g_new(owl_zwrite, 1);
    1010  if (owl_zwrite_create_from_line(z, line) < 0) {
    1111    owl_zwrite_delete(z);
Note: See TracChangeset for help on using the changeset viewer.