summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--riscos/filetype.c15
-rw-r--r--riscos/uri.c2
2 files changed, 14 insertions, 3 deletions
diff --git a/riscos/filetype.c b/riscos/filetype.c
index 5ce3dd0e5..13b2f9aca 100644
--- a/riscos/filetype.c
+++ b/riscos/filetype.c
@@ -49,11 +49,16 @@ const char *fetch_filetype(const char *unix_path)
{
struct type_entry *t;
unsigned int len = strlen(unix_path) + 100;
- char *path = xcalloc(len, 1);
+ char *path = calloc(len, 1);
char *r;
os_error *error;
bits file_type;
+ if (!path) {
+ LOG(("Insuficient memory for calloc"));
+ warn_user("NoMemory", 0);
+ return "application/riscos";
+ }
LOG(("unix_path = '%s'", unix_path));
/* convert path to RISC OS format and read file type */
@@ -84,7 +89,13 @@ char *fetch_mimetype(const char *ro_path) {
os_error *e;
bits filetype = 0, load;
int objtype;
- char *mime = xcalloc(256, sizeof(char));
+ char *mime = calloc(256, sizeof(char));
+
+ if (!mime) {
+ LOG(("Insuficient memory for calloc"));
+ warn_user("NoMemory", 0);
+ return 0;
+ }
e = xosfile_read_no_path(ro_path, &objtype, &load, 0, 0, 0);
if (e) return 0;
diff --git a/riscos/uri.c b/riscos/uri.c
index 035fa59f2..04edc208f 100644
--- a/riscos/uri.c
+++ b/riscos/uri.c
@@ -48,7 +48,7 @@ void ro_uri_message_received(uri_full_message_process* uri_message)
uri_message->sender);
xuri_request_uri(0, 0, 0, uri_handle, &uri_length);
- uri_requested = xcalloc((unsigned int)uri_length, sizeof(char));
+ uri_requested = calloc((unsigned int)uri_length, sizeof(char));
if (uri_requested == NULL)
return;