Changeset ddbbcffa for zwrite.c


Ignore:
Timestamp:
Feb 11, 2011, 4:31:42 PM (14 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master, release-1.10, release-1.8, release-1.9
Children:
d4927a7
Parents:
35b6eb9
git-author:
Anders Kaseorg <andersk@mit.edu> (08/27/09 00:52:41)
git-committer:
Anders Kaseorg <andersk@mit.edu> (02/11/11 16:31:42)
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
  • 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.