主要原因:对一个空指针进行操作。
例如:char* p = NULL:
string str(p); //运行时报错
FILE* install_log = fopen_path(install_file, "w");
if (install_log) {
fputs(path, install_log);
fputc('\n', install_log);
} else {
LOGE("failed to open last_install: %s\n", strerror(errno));
}
fclose(install_log);
return;