-/* $OpenBSD: httpd.c,v 1.3 2014/07/23 19:03:56 reyk Exp $ */
+/* $OpenBSD: httpd.c,v 1.4 2014/07/23 22:02:02 reyk Exp $ */
/*
* Copyright (c) 2014 Reyk Floeter <reyk@openbsd.org>
return (NULL);
memcpy(entry, media, sizeof(*entry));
+ if (media->media_encoding != NULL &&
+ (entry->media_encoding = strdup(media->media_encoding)) == NULL) {
+ free(entry);
+ return (NULL);
+ }
RB_INSERT(mediatypes, types, entry);
return (entry);
-/* $OpenBSD: parse.y,v 1.2 2014/07/13 14:17:37 reyk Exp $ */
+/* $OpenBSD: parse.y,v 1.3 2014/07/23 22:02:02 reyk Exp $ */
/*
* Copyright (c) 2007 - 2014 Reyk Floeter <reyk@openbsd.org>
(void)strlcpy(m.media_subtype,
mediatypes[i].media_subtype,
sizeof(m.media_subtype));
+ m.media_encoding = NULL;
if (media_add(conf->sc_mediatypes, &m) == NULL) {
log_warnx("failed to add default media \"%s\"",