Some tweaks to file areas

This commit is contained in:
Andrew Pamment 2018-02-21 09:59:26 +10:00
parent 532e1a6861
commit 836d30a46c
2 changed files with 4 additions and 4 deletions

View File

@ -945,7 +945,10 @@ int www_handler(void * cls, struct MHD_Connection * connection, const char * url
free(header);
free(footer);
return MHD_YES;
} else {
free(filen);
}
} else {
free(filen);
}
}

View File

@ -174,7 +174,6 @@ char *www_decode_hash(char *hash) {
snprintf(buffer, PATH_MAX, "%s/%s.sq3", conf.bbs_path, conf.file_directories[dir]->file_subs[sub]->database);
rc = sqlite3_open(buffer, &db);
if (rc != SQLITE_OK) {
dolog("Cannot open database: %s", sqlite3_errmsg(db));
return NULL;
}
sqlite3_busy_timeout(db, 5000);
@ -262,7 +261,6 @@ char *www_files_display_listing(int dir, int sub) {
rc = sqlite3_open(buffer, &db);
if (rc != SQLITE_OK) {
dolog_www("Cannot open database: %s", sqlite3_errmsg(db));
free(page);
return NULL;
}
@ -315,7 +313,7 @@ char *www_files_display_listing(int dir, int sub) {
strcat(page, buffer);
len += strlen(buffer);
description = www_sanitize((char *)sqlite3_column_text(res, 2));
description = strdup((char *)sqlite3_column_text(res, 2));
for (i=0;i<strlen(description);i++) {
if (description[i] == '\n') {
@ -428,7 +426,6 @@ char *www_files_get_from_area(int dir, int sub, char *file) {
rc = sqlite3_open(buffer, &db);
if (rc != SQLITE_OK) {
dolog_www("Cannot open database: %s", sqlite3_errmsg(db));
return NULL;
}
sqlite3_busy_timeout(db, 5000);