[Dhcp-agent-commits] dhcp-agent TODO,1.33,1.34 dhcp-cache-entry.c,1.8,1.9 dhcp-client-cache.c,1.14,1
Status: Alpha
Brought to you by:
actmodern
Update of /cvsroot/dhcp-agent/dhcp-agent In directory usw-pr-cvs1:/tmp/cvs-serv8575 Modified Files: TODO dhcp-cache-entry.c dhcp-client-cache.c dhcp-client-conf.c dhcp-client-control.c dhcp-client.c dhcp-convert.c dhcp-files.c dhcp-files.h dhcp-globconf.c dhcp-globconf.h dhcp-interface.c dhcp-net.c dhcp-sniff.c dhcp-stringbuffer.c dhcp-util.c dhcp-util.h dhcp-varfile.c Log Message: added xstrdup; integrated stringbuffer code into main code instead of string_splice; Index: TODO =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/TODO,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** TODO 2 Jul 2002 18:46:21 -0000 1.33 --- TODO 3 Jul 2002 00:51:39 -0000 1.34 *************** *** 68,79 **** -- other minor optimizations which would be nice are noted in FIXMEs all over the code. - -- be nice to servers. sort the list according to option tag value. - the highest value first seems about right. - -- clean up dhcp-packet-build.c -- the rawnet routines should be a shared library due to too many dependencies. the sniffer for example, only needs the packet parsing routines. - -- dhcpsniff needs as brief mode as well as some fixes to its - current output (timestamps aren't looking too good) -- get stringbuffer used in places where strings are being manipulated heavily. --- 68,74 ---- Index: dhcp-cache-entry.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-cache-entry.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** dhcp-cache-entry.c 17 Jun 2002 13:23:07 -0000 1.8 --- dhcp-cache-entry.c 3 Jul 2002 00:51:39 -0000 1.9 *************** *** 36,41 **** cache = xmalloc(sizeof(cache_entry_t)); ! cache->name = strdup(name); ! cache->value = strdup(value); return cache; --- 36,41 ---- cache = xmalloc(sizeof(cache_entry_t)); ! cache->name = xstrdup(name); ! cache->value = xstrdup(value); return cache; Index: dhcp-client-cache.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-client-cache.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** dhcp-client-cache.c 30 Jun 2002 08:23:45 -0000 1.14 --- dhcp-client-cache.c 3 Jul 2002 00:51:39 -0000 1.15 *************** *** 130,139 **** static char *get_fname(client_cache_t *cc) { ! return(splice_string(cc->interface, ".cache")); } static char *get_fname_tmp(client_cache_t *cc) { ! return(splice_string(cc->interface, ".cache.tmp")); } --- 130,153 ---- static char *get_fname(client_cache_t *cc) { ! char *fname; ! stringbuffer *sb = create_stringbuffer(); ! stringbuffer_aprintf(sb, "%s.%s", cc->interface, ".cache"); ! ! fname = xstrdup(stringbuffer_getstring(sb)); ! destroy_stringbuffer(sb); ! ! return fname; } static char *get_fname_tmp(client_cache_t *cc) { ! char *fname; ! stringbuffer *sb = create_stringbuffer(); ! stringbuffer_aprintf(sb, "%s.%s", cc->interface, ".cache.tmp"); ! ! fname = xstrdup(stringbuffer_getstring(sb)); ! destroy_stringbuffer(sb); ! ! return fname; } Index: dhcp-client-conf.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-client-conf.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** dhcp-client-conf.c 30 Jun 2002 08:23:45 -0000 1.13 --- dhcp-client-conf.c 3 Jul 2002 00:51:39 -0000 1.14 *************** *** 67,71 **** static char *get_conf_options_fname(client_conf_t *cc) { ! return(splice_string(cc->interface, ".opts")); } --- 67,78 ---- static char *get_conf_options_fname(client_conf_t *cc) { ! char *fname; ! stringbuffer *sb = create_stringbuffer(); ! stringbuffer_aprintf(sb, "%s.%s", cc->interface, ".opts"); ! ! fname = xstrdup(stringbuffer_getstring(sb)); ! destroy_stringbuffer(sb); ! ! return fname; } Index: dhcp-client-control.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-client-control.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** dhcp-client-control.c 2 Jul 2002 18:46:21 -0000 1.24 --- dhcp-client-control.c 3 Jul 2002 00:51:39 -0000 1.25 *************** *** 104,108 **** dc = xmalloc(sizeof(dhcp_client_control_t)); memset(dc, 0, sizeof(dhcp_client_control_t)); ! dc->interface = strdup(interface); return dc; --- 104,108 ---- dc = xmalloc(sizeof(dhcp_client_control_t)); memset(dc, 0, sizeof(dhcp_client_control_t)); ! dc->interface = xstrdup(interface); return dc; *************** *** 130,134 **** dc->state = 0; ! dc->interface = strdup(interface); dc->conf = create_client_conf(dc); dc->cache = create_client_cache(dc); --- 130,134 ---- dc->state = 0; ! dc->interface = xstrdup(interface); dc->conf = create_client_conf(dc); dc->cache = create_client_cache(dc); *************** *** 194,198 **** dc->class_id = splice_many_strings(4, utsname.sysname, utsname.nodename, utsname.release, utsname.version, utsname.machine); #else /* HAVE_UNAME */ ! dc->class_id = strdup("Unknown"); #endif /* HAVE_UNAME */ --- 194,198 ---- dc->class_id = splice_many_strings(4, utsname.sysname, utsname.nodename, utsname.release, utsname.version, utsname.machine); #else /* HAVE_UNAME */ ! dc->class_id = xstrdup("Unknown"); #endif /* HAVE_UNAME */ Index: dhcp-client.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-client.c,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** dhcp-client.c 2 Jul 2002 18:41:40 -0000 1.39 --- dhcp-client.c 3 Jul 2002 00:51:39 -0000 1.40 *************** *** 92,106 **** static void read_global_conf(const char *interface) { ! char *filename; ! filename = splice_string(interface, ".conf"); ! if(init_glob_conf(filename)) { push_exception("main", "read_global_conf", ! "could not read nor create global configuration file: %s", filename); exception_errors = unroll_exceptions(); fatal_error_exception(exception_errors); } ! xfree(filename); return; } --- 92,109 ---- static void read_global_conf(const char *interface) { ! stringbuffer *sb; ! sb = create_stringbuffer(); ! stringbuffer_aprintf(sb, "%s %s", interface, ".conf"); ! ! if(init_glob_conf(stringbuffer_getstring(sb))) { push_exception("main", "read_global_conf", ! "could not read nor create global configuration file: %s", ! stringbuffer_getstring(sb)); exception_errors = unroll_exceptions(); fatal_error_exception(exception_errors); } ! destroy_stringbuffer(sb); return; } *************** *** 195,199 **** return NULL; ! first_interface = strdup(interface_list->data); purge_list(interface_list, NULL); return first_interface; --- 198,202 ---- return NULL; ! first_interface = xstrdup(interface_list->data); purge_list(interface_list, NULL); return first_interface; *************** *** 532,536 **** case 'd': ! work_dir = strdup(optarg); break; --- 535,539 ---- case 'd': ! work_dir = xstrdup(optarg); break; *************** *** 542,550 **** case 'i': ! interface = strdup(optarg); break; case 'm': ! fake_hw_addr = strdup(optarg); break; --- 545,553 ---- case 'i': ! interface = xstrdup(optarg); break; case 'm': ! fake_hw_addr = xstrdup(optarg); break; Index: dhcp-convert.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-convert.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** dhcp-convert.c 2 Jul 2002 18:35:44 -0000 1.16 --- dhcp-convert.c 3 Jul 2002 00:51:39 -0000 1.17 *************** *** 182,193 **** char *network_byte_to_string_byte(const unsigned char *data, int len) { char *s; if(len < 1) return NULL; ! ! s = xmalloc(BYTE_STRING_SIZE); ! snprintf(s, BYTE_STRING_SIZE, "0x%hhx", *(unsigned char *)data); ! return s; } --- 182,198 ---- char *network_byte_to_string_byte(const unsigned char *data, int len) { + stringbuffer *sb; char *s; if(len < 1) return NULL; ! ! sb = create_stringbuffer(); ! ! stringbuffer_aprintf(sb, "0x%hhx", *(unsigned char *)data); ! ! s = xstrdup(stringbuffer_getstring(sb)); ! destroy_stringbuffer(sb); ! return s; } *************** *** 224,228 **** memcpy(&address.s_addr, data, IP_ADDR_LEN); ! return(strdup(inet_ntoa(address))); } --- 229,233 ---- memcpy(&address.s_addr, data, IP_ADDR_LEN); ! return(xstrdup(inet_ntoa(address))); } *************** *** 230,278 **** char *network_addr_list_to_string(const unsigned char *data, int len) { char *string; - char *tmp, *new_string; ! if(len < IP_ADDR_LEN) ! return NULL; ! ! string = network_addr_to_string(data, len); ! if(string == NULL) return NULL; ! ! tmp = string; ! string = splice_string(string, ";"); ! xfree(tmp); ! ! len -= 4; ! data += 4; ! ! while(len >= 4) { ! ! tmp = string; ! new_string = network_addr_to_string(data, len); ! ! if(new_string == NULL) { ! ! /* truncated address. Just do our best. */ ! ! string = splice_string(string, ";"); ! free(tmp); ! return string; ! } ! string = splice_string(string, new_string); ! xfree(tmp); ! xfree(new_string); ! tmp = string; ! string = splice_string(string, ";"); ! xfree(tmp); ! data += 4; len -= 4; } ! return string; } --- 235,282 ---- char *network_addr_list_to_string(const unsigned char *data, int len) { + stringbuffer *sb; char *string; ! if(len < IP_ADDR_LEN) { ! warn_message("network addr to list: address passed too small."); return NULL; ! } ! sb = create_stringbuffer(); ! while(len >= 0) { ! string = network_addr_to_string(data, len); ! if(string == NULL) { ! warn_message("network addr to list: skipping malformed address"); ! ! } else { ! ! stringbuffer_append(sb, string); ! stringbuffer_append_c(sb, ';'); ! xfree(string); ! ! } ! len -= 4; + data += 4; + } ! ! string = xstrdup(stringbuffer_getstring(sb)); ! ! if(strlen(string) == 0) { ! ! warn_message("network addr to list: no valid addresses passed."); ! destroy_stringbuffer(sb); ! xfree(string); ! return NULL; ! ! } else { ! ! destroy_stringbuffer(sb); return string; + } } *************** *** 297,301 **** char *cp, *tmp_string, *orig_string; ! tmp_string = strdup(string); /* don't overwrite old string. */ trim_string(tmp_string); orig_string = tmp_string; --- 301,305 ---- char *cp, *tmp_string, *orig_string; ! tmp_string = xstrdup(string); /* don't overwrite old string. */ trim_string(tmp_string); orig_string = tmp_string; *************** *** 334,338 **** int count = 0; uint32_t *data, *cp; ! for(ptr = addr_list;ptr;ptr = ptr->next) count++; --- 338,342 ---- int count = 0; uint32_t *data, *cp; ! for(ptr = addr_list;ptr;ptr = ptr->next) count++; *************** *** 394,398 **** /* otherwise strdup a copy. */ ! return strdup(data); } --- 398,402 ---- /* otherwise strdup a copy. */ ! return xstrdup(data); } *************** *** 413,417 **** * into the right places. */ ! return strdup(data); } --- 417,421 ---- * into the right places. */ ! return xstrdup(data); } *************** *** 419,423 **** void *strdup_wrap(const char *s) { ! return(strdup(s)); } --- 423,427 ---- void *strdup_wrap(const char *s) { ! return(xstrdup(s)); } *************** *** 439,442 **** --- 443,447 ---- size_t size, int si) { + stringbuffer *sb; char *string; *************** *** 444,447 **** --- 449,453 ---- return NULL; + sb = create_stringbuffer(); if(si) { /* signed. */ *************** *** 449,459 **** case sizeof(int32_t): ! string = xmalloc(INT32_T_STRING_SIZE); ! snprintf(string, INT32_T_STRING_SIZE, "%"PRIi32"", *(int32_t *)data); break; case sizeof(int16_t): ! string = xmalloc(INT16_T_STRING_SIZE); ! snprintf(string, INT16_T_STRING_SIZE, "%"PRIi16"", *(int16_t *)data); break; --- 455,463 ---- case sizeof(int32_t): ! stringbuffer_aprintf(sb, "%"PRIi32"", *(int32_t *)data); break; case sizeof(int16_t): ! stringbuffer_aprintf(sb, "%"PRIi16"", *(int16_t *)data); break; *************** *** 469,479 **** case sizeof(uint32_t): ! string = xmalloc(UINT32_T_STRING_SIZE); ! snprintf(string, UINT32_T_STRING_SIZE, "%"PRIu32"", *(uint32_t *)data); break; case sizeof(uint16_t): ! string = xmalloc(UINT16_T_STRING_SIZE); ! snprintf(string, UINT16_T_STRING_SIZE, "%"PRIu16"", *(uint16_t *)data); break; --- 473,481 ---- case sizeof(uint32_t): ! stringbuffer_aprintf(sb, "%"PRIu32"", *(uint32_t *)data); break; case sizeof(uint16_t): ! stringbuffer_aprintf(sb, "%"PRIu16"", *(uint16_t *)data); break; *************** *** 484,488 **** } } ! return string; } --- 486,492 ---- } } ! ! string = xstrdup(stringbuffer_getstring(sb)); ! destroy_stringbuffer(sb); return string; } *************** *** 593,599 **** char *network_uint16_list_to_string(const unsigned char *data, int len) { ! char *tmp; ! char *s = NULL; ! char *string = NULL; if(len == 0 || --- 597,603 ---- char *network_uint16_list_to_string(const unsigned char *data, int len) { ! ! stringbuffer *sb; ! char *string; if(len == 0 || *************** *** 601,625 **** return NULL; ! for(;len > 0;len -= sizeof(uint16_t)) { ! ! s = network_uint16_to_string(data, sizeof(uint16_t)); ! if(s == NULL) ! return string; ! tmp = string; ! string = splice_string(s, string); ! ! if(tmp != NULL) ! xfree(tmp); ! xfree(s); ! ! tmp = string; ! string = splice_string(string, ";"); ! free(tmp); ! data += sizeof(uint16_t); } ! ! return string; } --- 605,642 ---- return NULL; ! sb = create_stringbuffer(); ! while(len > 0) { ! string = network_uint16_to_string(data, sizeof(uint16_t)); ! ! if(string == NULL) { ! ! warn_message("network_uint16_list_to_string: malformed data -- skipping"); ! ! } else { ! ! stringbuffer_append(sb, string); ! stringbuffer_append_c(sb, ';'); ! ! xfree(string); ! } ! ! len -= sizeof(uint16_t); ! data += sizeof(uint16_t); } ! ! string = xstrdup(stringbuffer_getstring(sb)); ! ! if(strlen(string) == 0) { ! warn_message("uint16_t list to string: no valid integers passed."); ! xfree(string); ! destroy_stringbuffer(sb); ! return NULL; ! } else { ! destroy_stringbuffer(sb); ! return string; ! } ! } Index: dhcp-files.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-files.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** dhcp-files.c 30 Jun 2002 20:43:10 -0000 1.14 --- dhcp-files.c 3 Jul 2002 00:51:39 -0000 1.15 *************** *** 86,90 **** /* check if a file exists. -- achtung: watch out for race * conditions */ ! int file_exists(char *fname) { FILE *fp; --- 86,90 ---- /* check if a file exists. -- achtung: watch out for race * conditions */ ! int file_exists(const char *fname) { FILE *fp; Index: dhcp-files.h =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-files.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** dhcp-files.h 30 Jun 2002 08:23:45 -0000 1.5 --- dhcp-files.h 3 Jul 2002 00:51:39 -0000 1.6 *************** *** 30,34 **** extern FILE *file_create_and_truncate_safe(const char *filename, char *mode); ! extern int file_exists(char *fname); extern void move_file(char *fname, char *dest); extern int delete_file(char *fname); --- 30,34 ---- extern FILE *file_create_and_truncate_safe(const char *filename, char *mode); ! extern int file_exists(const char *fname); extern void move_file(char *fname, char *dest); extern int delete_file(char *fname); Index: dhcp-globconf.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-globconf.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** dhcp-globconf.c 30 Jun 2002 21:22:15 -0000 1.11 --- dhcp-globconf.c 3 Jul 2002 00:51:39 -0000 1.12 *************** *** 103,107 **** /* read configuration options in and set variables. */ ! int init_glob_conf(unsigned char *filename) { varfile_t *varfile; --- 103,107 ---- /* read configuration options in and set variables. */ ! int init_glob_conf(const char *filename) { varfile_t *varfile; Index: dhcp-globconf.h =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-globconf.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** dhcp-globconf.h 30 Jun 2002 21:22:15 -0000 1.5 --- dhcp-globconf.h 3 Jul 2002 00:51:39 -0000 1.6 *************** *** 37,41 **** } glob_conf_t; ! extern int init_glob_conf(unsigned char *filename); extern void *glob_conf_get_val(int val_index); extern void glob_conf_set_val(void *val, int option); --- 37,41 ---- } glob_conf_t; ! extern int init_glob_conf(const char *filename); extern void *glob_conf_get_val(int val_index); extern void glob_conf_set_val(void *val, int option); Index: dhcp-interface.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-interface.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** dhcp-interface.c 30 Jun 2002 08:23:45 -0000 1.20 --- dhcp-interface.c 3 Jul 2002 00:51:39 -0000 1.21 *************** *** 217,221 **** if(check(entry)) { ! intf_name = strdup(entry->intf_name); interfaces = add_to_end_of_list(interfaces, intf_name); } --- 217,221 ---- if(check(entry)) { ! intf_name = xstrdup(entry->intf_name); interfaces = add_to_end_of_list(interfaces, intf_name); } Index: dhcp-net.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-net.c,v retrieving revision 1.31 retrieving revision 1.32 diff -C2 -d -r1.31 -r1.32 *** dhcp-net.c 30 Jun 2002 20:22:26 -0000 1.31 --- dhcp-net.c 3 Jul 2002 00:51:39 -0000 1.32 *************** *** 202,207 **** net->src_port = dhcp_src_port; net->dst_port = dhcp_dst_port; ! net->device = strdup(device); ! net->pcap_filter = strdup(filter); net->packet_data = xcalloc(DEFAULT_MTU); /* XXX -- fixme make mtu configurable. */ net->promiscuous = promiscuous; --- 202,207 ---- net->src_port = dhcp_src_port; net->dst_port = dhcp_dst_port; ! net->device = xstrdup(device); ! net->pcap_filter = xstrdup(filter); net->packet_data = xcalloc(DEFAULT_MTU); /* XXX -- fixme make mtu configurable. */ net->promiscuous = promiscuous; Index: dhcp-sniff.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-sniff.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** dhcp-sniff.c 30 Jun 2002 08:23:45 -0000 1.14 --- dhcp-sniff.c 3 Jul 2002 00:51:39 -0000 1.15 *************** *** 66,70 **** case 'i': ! interface_name = strdup(optarg); break; --- 66,70 ---- case 'i': ! interface_name = xstrdup(optarg); break; *************** *** 90,94 **** if(available_interfaces != NULL) { ! interface_name = strdup(available_interfaces->data); purge_list(available_interfaces, NULL); --- 90,94 ---- if(available_interfaces != NULL) { ! interface_name = xstrdup(available_interfaces->data); purge_list(available_interfaces, NULL); Index: dhcp-stringbuffer.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-stringbuffer.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** dhcp-stringbuffer.c 30 Jun 2002 08:23:45 -0000 1.7 --- dhcp-stringbuffer.c 3 Jul 2002 00:51:39 -0000 1.8 *************** *** 73,77 **** if(strlen(s) < end) { *len = strlen(s); ! return strdup(s); } --- 73,77 ---- if(strlen(s) < end) { *len = strlen(s); ! return xstrdup(s); } Index: dhcp-util.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-util.c,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** dhcp-util.c 2 Jul 2002 17:09:15 -0000 1.23 --- dhcp-util.c 3 Jul 2002 00:51:39 -0000 1.24 *************** *** 227,231 **** #ifndef HAVE_STRDUP ! char *strdup(char *s) { char *newstring; --- 227,231 ---- #ifndef HAVE_STRDUP ! char *strdup(const char *s) { char *newstring; *************** *** 241,244 **** --- 241,257 ---- #endif + /* strdup wrapper to check if strdup (especially if its the + * system implementation and not ours) returns NULL. Then + * abort. */ + + char *xstrdup(const char *string) + { + char *s = strdup(string); + if(s == NULL) + fatal_error("could not allocate memory! aborting!"); + + return s; + } + /* signal manipulation routines. */ *************** *** 348,352 **** char *new_string; ! new_string = strdup(string); if(num <= 1) --- 361,365 ---- char *new_string; ! new_string = xstrdup(string); if(num <= 1) *************** *** 436,440 **** new_string = splice_string(string, ":"); else ! new_string = strdup(string); if(strlen(new_string) > 18) { --- 449,453 ---- new_string = splice_string(string, ":"); else ! new_string = xstrdup(string); if(strlen(new_string) > 18) { Index: dhcp-util.h =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-util.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** dhcp-util.h 2 Jul 2002 18:35:44 -0000 1.9 --- dhcp-util.h 3 Jul 2002 00:51:39 -0000 1.10 *************** *** 74,77 **** --- 74,78 ---- extern int port_for_service(const char *serv, const char *proto); extern int is_seven_bit_clean(const char *data, int len); + extern char *xstrdup(const char *string); #endif /* DHCP_UTIL_H */ Index: dhcp-varfile.c =================================================================== RCS file: /cvsroot/dhcp-agent/dhcp-agent/dhcp-varfile.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** dhcp-varfile.c 22 Jun 2002 18:11:25 -0000 1.3 --- dhcp-varfile.c 3 Jul 2002 00:51:39 -0000 1.4 *************** *** 50,54 **** varfile = xmalloc(sizeof(varfile_t)); ! varfile->filename = strdup(filename); varfile->var_name = create_stringbuffer(); varfile->var_val = create_stringbuffer(); --- 50,54 ---- varfile = xmalloc(sizeof(varfile_t)); ! varfile->filename = xstrdup(filename); varfile->var_name = create_stringbuffer(); varfile->var_val = create_stringbuffer(); |