summaryrefslogtreecommitdiffstats
path: root/src/rest.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/rest.c')
-rw-r--r--src/rest.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/rest.c b/src/rest.c
index cf572bd..4709fc9 100644
--- a/src/rest.c
+++ b/src/rest.c
@@ -3356,7 +3356,7 @@ static int og_cmd_restore_image(json_t *element, struct og_msg_params *params)
static int og_cmd_delete_image(json_t *element, struct og_msg_params *params)
{
- char filename[PATH_MAX + 1];
+ char filename[PATH_MAX + 1], checksum[PATH_MAX + 1];
const char *key, *image;
struct og_dbi *dbi;
dbi_result result;
@@ -3405,6 +3405,8 @@ static int og_cmd_delete_image(json_t *element, struct og_msg_params *params)
image = dbi_result_get_string(result, "nombreca");
snprintf(filename, sizeof(filename), "%s/%s.img", ogconfig.repo.dir,
image);
+ snprintf(checksum, sizeof(checksum), "%s/%s.img.full.sum", ogconfig.repo.dir,
+ image);
dbi_result_free(result);
result = dbi_conn_queryf(dbi->conn,
@@ -3426,6 +3428,8 @@ static int og_cmd_delete_image(json_t *element, struct og_msg_params *params)
dbi_result_free(result);
unlink(filename);
+ unlink(checksum);
+
og_dbi_close(dbi);
return 0;