- Timestamp:
- Feb 11, 2011, 4:31:42 PM (14 years ago)
- Branches:
- master, release-1.10, release-1.8, release-1.9
- Children:
- d4927a7
- Parents:
- 35b6eb9
- git-author:
- Anders Kaseorg <andersk@mit.edu> (08/27/09 00:52:41)
- git-committer:
- Anders Kaseorg <andersk@mit.edu> (02/11/11 16:31:42)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
zwrite.c
r96828e4 rddbbcffa 145 145 if(msg) { 146 146 owl_zwrite_set_message(z, msg); 147 owl_free(msg);147 g_free(msg); 148 148 } 149 149 … … 181 181 } 182 182 send_ping(to, z->class, z->inst); 183 owl_free(to);183 g_free(to); 184 184 } 185 185 … … 189 189 void owl_zwrite_set_message_raw(owl_zwrite *z, const char *msg) 190 190 { 191 if (z->message) owl_free(z->message);191 if (z->message) g_free(z->message); 192 192 z->message = owl_validate_utf8(msg); 193 193 } … … 199 199 char *tmp = NULL, *tmp2; 200 200 201 if (z->message) owl_free(z->message);201 if (z->message) g_free(z->message); 202 202 203 203 j=owl_list_get_size(&(z->recips)); … … 211 211 toline = owl_sprintf( "%s%s ", toline, (const char *) owl_list_get_element(&(z->recips), i)); 212 212 } 213 owl_free(tmp);213 g_free(tmp); 214 214 tmp = NULL; 215 215 } … … 217 217 tmp2 = owl_text_expand_tabs(tmp); 218 218 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); 222 222 } else { 223 223 tmp=owl_validate_utf8(msg); 224 224 z->message=owl_text_expand_tabs(tmp); 225 owl_free(tmp);225 g_free(tmp); 226 226 } 227 227 } … … 258 258 if (ret != 0) 259 259 break; 260 owl_free(to);260 g_free(to); 261 261 to = NULL; 262 262 } … … 265 265 ret = send_zephyr(z->opcode, z->zsig, z->class, z->inst, to, z->message); 266 266 } 267 owl_free(to);267 g_free(to); 268 268 return ret; 269 269 } … … 301 301 void owl_zwrite_set_opcode(owl_zwrite *z, const char *opcode) 302 302 { 303 if (z->opcode) owl_free(z->opcode);303 if (z->opcode) g_free(z->opcode); 304 304 z->opcode=owl_validate_utf8(opcode); 305 305 } … … 318 318 void owl_zwrite_set_zsig(owl_zwrite *z, const char *zsig) 319 319 { 320 if(z->zsig) owl_free(z->zsig);320 if(z->zsig) g_free(z->zsig); 321 321 z->zsig = owl_strdup(zsig); 322 322 } … … 362 362 { 363 363 owl_zwrite_cleanup(z); 364 owl_free(z);364 g_free(z); 365 365 } 366 366 367 367 void owl_zwrite_cleanup(owl_zwrite *z) 368 368 { 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); 378 378 } 379 379 … … 381 381 * Returns a zwrite line suitable for replying, specifically the 382 382 * message field is stripped out. Result should be freed with 383 * owl_free.383 * g_free. 384 384 */ 385 385 char *owl_zwrite_get_replyline(const owl_zwrite *z)
Note: See TracChangeset
for help on using the changeset viewer.