bring mg_strdup() back

This commit is contained in:
Sergio R. Caprile committed 2024-05-31 17:45:53 -03:00
1 parent a4e0225c69
commit ab75bfa6e7
11 files changed
+46 -16

No files matched your search

+1 -2
View File
@@ -1233,8 +1233,7 @@ static int mg_parse_pem(const struct mg_str pem, const struct mg_str label,
const char *c;
struct mg_str caps[5];
if (!mg_match(pem, mg_str("#-----BEGIN #-----#-----END #-----#"), caps)) {
der->buf = mg_mprintf("%.*s", pem.len, pem.buf);
der->len = pem.len;
*der = mg_strdup(pem);
return 0;
}
if (mg_strcmp(caps[1], label) != 0 || mg_strcmp(caps[3], label) != 0) {