- 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
-
zephyr.c
r35b6eb9 rddbbcffa 112 112 owl_zephyr_loadsubs_helper(subs->subs, subs->nsubs); 113 113 deferred_subs = g_list_delete_link(deferred_subs, deferred_subs); 114 owl_free(subs);114 g_free(subs); 115 115 } 116 116 … … 127 127 128 128 perl = owl_perlconfig_execute("BarnOwl::Zephyr::_zephyr_startup()"); 129 owl_free(perl);129 g_free(perl); 130 130 131 131 owl_select_add_pre_select_action(owl_zephyr_pre_select_action, NULL, NULL); … … 222 222 /* free stuff */ 223 223 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); 230 230 } else { 231 231 owl_sub_list *s = g_new(owl_sub_list, 1); … … 263 263 264 264 if (stat(subsfile, &statbuff) != 0) { 265 owl_free(subsfile);265 g_free(subsfile); 266 266 if (error_on_nofile == 1) 267 267 return -1; … … 272 272 count = 0; 273 273 file = fopen(subsfile, "r"); 274 owl_free(subsfile);274 g_free(subsfile); 275 275 if (!file) 276 276 return -1; … … 304 304 if (buffer[0] == '-') { 305 305 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); 309 309 } else { 310 310 count++; … … 313 313 fclose(file); 314 314 if (buffer) 315 owl_free(buffer);315 g_free(buffer); 316 316 317 317 return owl_zephyr_loadsubs_helper(subs, count); … … 381 381 382 382 if (stat(subsfile, &statbuff) == -1) { 383 owl_free(subs);384 owl_free(subsfile);383 g_free(subs); 384 g_free(subsfile); 385 385 return 0; 386 386 } … … 389 389 count = 0; 390 390 file = fopen(subsfile, "r"); 391 owl_free(subsfile);391 g_free(subsfile); 392 392 if (file) { 393 393 while (owl_getline_chomp(&buffer, file)) { … … 411 411 } 412 412 if (buffer) 413 owl_free(buffer);413 g_free(buffer); 414 414 415 415 return owl_zephyr_loadsubs_helper(subs, count); … … 530 530 tmp = g_strndup(n->z_message + save, n->z_message_len - save); 531 531 out = owl_validate_or_convert(tmp); 532 owl_free(tmp);532 g_free(tmp); 533 533 return out; 534 534 } … … 589 589 590 590 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); 593 593 if (msg) { 594 594 return msg; … … 607 607 608 608 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); 614 614 if (msg) { 615 615 return msg; … … 623 623 624 624 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); 626 626 if (msg) { 627 627 return msg; … … 702 702 703 703 /* free then check the return */ 704 owl_free(notice.z_message);704 g_free(notice.z_message); 705 705 ZFreeNotice(¬ice); 706 706 if (ret!=ZERR_NONE) { … … 755 755 owl_function_makemsg("Message sent to %s on -c %s -i %s\n", tmp, retnotice->z_class, retnotice->z_class_inst); 756 756 } 757 owl_free(tmp);757 g_free(tmp); 758 758 } else { 759 759 /* class / instance message */ … … 820 820 821 821 owl_zwrite_cleanup(&zw); 822 owl_free(tmp);822 g_free(tmp); 823 823 } 824 824 } else { … … 886 886 tmpbuff = owl_sprintf("zwrite -i %s %s", owl_message_get_instance(m), myuser); 887 887 } 888 owl_free(myuser);889 owl_free(to);888 g_free(myuser); 889 g_free(to); 890 890 891 891 z = owl_zwrite_new(tmpbuff); … … 896 896 mout=owl_function_make_outgoing_zephyr(z); 897 897 owl_global_messagequeue_addmsg(&g, mout); 898 owl_free(tmpbuff);898 g_free(tmpbuff); 899 899 owl_zwrite_delete(z); 900 900 #endif … … 942 942 locations.tty ? locations.tty : "?", 943 943 locations.time ? locations.time : "?"); 944 owl_free(result);944 g_free(result); 945 945 result = p; 946 946 } 947 947 } 948 owl_free(myuser);948 g_free(myuser); 949 949 950 950 return result; … … 974 974 } 975 975 fclose(file); 976 owl_free(s);976 g_free(s); 977 977 } 978 978 … … 988 988 } 989 989 990 owl_free(line);990 g_free(line); 991 991 #endif 992 992 } … … 1009 1009 owl_function_error("No subscription present in %s", subsfile); 1010 1010 } 1011 owl_free(subsfile);1012 owl_free(line);1011 g_free(subsfile); 1012 g_free(line); 1013 1013 #endif 1014 1014 } … … 1078 1078 filename = owl_zephyr_dotfile(".anyone", NULL); 1079 1079 file = fopen(filename, "a"); 1080 owl_free(filename);1080 g_free(filename); 1081 1081 if (!file) { 1082 1082 owl_function_error("Error opening zephyr buddy file for append"); … … 1093 1093 filename = owl_zephyr_dotfile(".anyone", NULL); 1094 1094 owl_util_file_deleteline(filename, name, 0); 1095 owl_free(filename);1095 g_free(filename); 1096 1096 } 1097 1097 … … 1151 1151 sub.zsub_recipient); 1152 1152 g_string_prepend(buf, tmp); 1153 owl_free(tmp);1153 g_free(tmp); 1154 1154 } 1155 1155 } … … 1269 1269 if (!f) { 1270 1270 owl_function_error("Error opening file %s: %s", ourfile, strerror(errno) ? strerror(errno) : ""); 1271 owl_free(ourfile);1271 g_free(ourfile); 1272 1272 return -1; 1273 1273 } 1274 owl_free(ourfile);1274 g_free(ourfile); 1275 1275 1276 1276 while (owl_getline_chomp(&s, f)) { … … 1291 1291 owl_list_append_element(in, long_zuser(s)); 1292 1292 } 1293 owl_free(s);1293 g_free(s); 1294 1294 fclose(f); 1295 1295 return 0; … … 1355 1355 } 1356 1356 ZFreeALD(zald); 1357 owl_free(zald);1357 g_free(zald); 1358 1358 } 1359 1359 }
Note: See TracChangeset
for help on using the changeset viewer.