Syscall param open(filename) points to unaddressable byte(s)

valgrind 调试出现如题所示的错误,原因是存取文件名的空间被释放了

源代码:

        cfg->snteam_cfg->snt.score.nd.wrd_dict_db_fn=cfg->wrd_dict_db_fn;

修改之后:          

	cfg->snteam_cfg->snt.heap = wtk_heap_new(1024);
	cfg->snteam_cfg->snt.score.nd.wrd_dict_db_fn= wtk_heap_dup_str(cfg->snteam_cfg->snt.heap, cfg->wrd_dict_db_fn);

  

posted on 2015-07-29 11:33  袁军峰  阅读(929)  评论(0编辑  收藏  举报

导航