main:Fix segfault when socket does not exist
This commit is contained in:
parent
778d75396e
commit
1545e3140d
@ -79,6 +79,7 @@ sqlite3* get_db() {
|
|||||||
|
|
||||||
void notify_change() {
|
void notify_change() {
|
||||||
char* socket_path = get_socket_path();
|
char* socket_path = get_socket_path();
|
||||||
|
if (access(socket_path, F_OK) == 0) {
|
||||||
FILE* fp = fopen(socket_path, "r");
|
FILE* fp = fopen(socket_path, "r");
|
||||||
|
|
||||||
int pid;
|
int pid;
|
||||||
@ -86,6 +87,8 @@ void notify_change() {
|
|||||||
(void)pid;
|
(void)pid;
|
||||||
|
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
}
|
||||||
|
free(socket_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user