]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-plain.c
Mark char* fields in struct cgit_page as const
[ps-cgit] / ui-plain.c
index 4397a59e3809da6cf71c84ddd5b2c7d3afe94b2e..482d53a89f3d02d231f71fbee5d70874a618c1b4 100644 (file)
@@ -100,8 +100,9 @@ static int print_object(const unsigned char *sha1, const char *path)
        ctx.page.etag = sha1_to_hex(sha1);
        cgit_print_http_headers(&ctx);
        html_raw(buf, size);
+       /* If we allocated this, then casting away const is safe. */
        if (freemime)
-               free(ctx.page.mimetype);
+               free((char*) ctx.page.mimetype);
        return 1;
 }