ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/libstatgrab/src/libstatgrab/network_stats.c
(Generate patch)

Comparing projects/libstatgrab/src/libstatgrab/network_stats.c (file contents):
Revision 1.77 by tdb, Sun Jan 22 18:10:39 2006 UTC vs.
Revision 1.78 by tdb, Mon Oct 9 14:09:38 2006 UTC

# Line 230 | Line 230 | sg_network_io_stats *sg_get_network_io_stats(int *entr
230  
231                          /* Create new network_stats */
232                          if (VECTOR_RESIZE(network_stats, interfaces + 1) < 0) {
233 +                                kstat_close(kc);
234                                  return NULL;
235                          }
236                          network_stat_ptr=network_stats+interfaces;
# Line 276 | Line 277 | sg_network_io_stats *sg_get_network_io_stats(int *entr
277                          /* Read interface name */
278                          if (sg_update_string(&network_stat_ptr->interface_name,
279                                               ksp->ks_name) < 0) {
280 +                                kstat_close(kc);
281                                  return NULL;
282                          }
283  
# Line 665 | Line 667 | sg_network_iface_stats *sg_get_network_iface_stats(int
667  
668          if ((sock = socket(PF_INET, SOCK_DGRAM, IPPROTO_IP)) < 0) {
669                  sg_set_error_with_errno(SG_ERROR_SOCKET, NULL);
670 +                kstat_close(kc);
671                  return NULL;
672          }
673  
# Line 681 | Line 684 | sg_network_iface_stats *sg_get_network_iface_stats(int
684                          }
685  
686                          if (VECTOR_RESIZE(network_iface_stats, ifaces + 1) < 0) {
687 +                                kstat_close(kc);
688                                  return NULL;
689                          }
690                          network_iface_stat_ptr = network_iface_stats + ifaces;
# Line 688 | Line 692 | sg_network_iface_stats *sg_get_network_iface_stats(int
692  
693                          if (sg_update_string(&network_iface_stat_ptr->interface_name,
694                                               ksp->ks_name) < 0) {
695 +                                kstat_close(kc);
696                                  return NULL;
697                          }
698  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines