- 論壇徽章:
- 0
|
問題來了,在移植djbdns的代碼,跟蹤到這里,發(fā)現(xiàn)在1111111111處停下來,如果注釋掉111111111,那么就在222222222處停下來
按理說1111111111和222222222222都只是簡單操作,111處為無返回值的操作,222處為簡單賦值。程序運行也沒有崩潰信息,只是正常退出
求解為什么退出?
- //**out是一段域名,如03www05baidu03com
- int dns_domain_copy(char **out,const char *in)
- {
- unsigned int len;
- char *x;
- printf("zengqjdebug file=%s, line = %d\r\n", __FILE__, __LINE__);
- len = dns_domain_length(in);
- printf("zengqjdebug file=%s, line = %d\r\n", __FILE__, __LINE__);
- x = alloc(len);
- printf("zengqjdebug file=%s, line = %d\r\n", __FILE__, __LINE__);
- if (!x) return 0;
- printf("zengqjdebug file=%s, line = %d\r\n", __FILE__, __LINE__);
- byte_copy(x,len,in);
- printf("zengqjdebug file=%s, line = %d\r\n", __FILE__, __LINE__);
- if (*out) alloc_free(*out);//1111111111111
- printf("zengqjdebug file=%s, line = %d\r\n", __FILE__, __LINE__);
- *out = x;//22222222222222
- printf("zengqjdebug file=%s, line = %d\r\n", __FILE__, __LINE__);
- return 1;
- }
復(fù)制代碼 |
|