summaryrefslogtreecommitdiffstats
path: root/src/rest.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rest.c')
-rw-r--r--src/rest.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/rest.c b/src/rest.c
index 4c7c927..6e4ba04 100644
--- a/src/rest.c
+++ b/src/rest.c
@@ -1834,6 +1834,11 @@ static int og_cmd_post_client_delete(json_t *element,
og_dbi_close(dbi);
return -1;
}
+ if (dbi_result_get_numrows_affected(result) < 1) {
+ dbi_result_free(result);
+ og_dbi_close(dbi);
+ return -1;
+ }
dbi_result_free(result);
}
@@ -2580,6 +2585,11 @@ static int og_cmd_delete_image(json_t *element, struct og_msg_params *params)
syslog(LOG_ERR, "failed to query database\n");
return -1;
}
+ if (dbi_result_get_numrows_affected(result) < 1) {
+ dbi_result_free(result);
+ og_dbi_close(dbi);
+ return -1;
+ }
dbi_result_free(result);
rval = unlink(filename);
@@ -4742,6 +4752,12 @@ static int og_cmd_post_center_delete(json_t *element,
return -1;
}
+ if (dbi_result_get_numrows_affected(result) < 1) {
+ dbi_result_free(result);
+ og_dbi_close(dbi);
+ return -1;
+ }
+
dbi_result_free(result);
og_dbi_close(dbi);
@@ -5332,6 +5348,11 @@ static int og_cmd_post_repository_delete(json_t *element,
og_dbi_close(dbi);
return -1;
}
+ if (dbi_result_get_numrows_affected(result) < 1) {
+ dbi_result_free(result);
+ og_dbi_close(dbi);
+ return -1;
+ }
dbi_result_free(result);
og_dbi_close(dbi);
@@ -5487,6 +5508,11 @@ static int og_cmd_post_room_delete(json_t *element,
og_dbi_close(dbi);
return -1;
}
+ if (dbi_result_get_numrows_affected(result) < 1) {
+ dbi_result_free(result);
+ og_dbi_close(dbi);
+ return -1;
+ }
dbi_result_free(result);
@@ -5953,6 +5979,11 @@ static int og_cmd_delete_server(json_t *element,
og_dbi_close(dbi);
return -1;
}
+ if (dbi_result_get_numrows_affected(result) < 1) {
+ dbi_result_free(result);
+ og_dbi_close(dbi);
+ return -1;
+ }
dbi_result_free(result);
og_dbi_close(dbi);