diff options
author | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-09-30 20:19:44 -0700 |
---|---|---|
committer | Alan Coopersmith <alan.coopersmith@oracle.com> | 2011-09-30 20:19:44 -0700 |
commit | edca92c10572b6bb7dd60db156f545d98373f803 (patch) | |
tree | 0f22fb5c4203c48c2a8d7f6a71692f9b689d791d /extensions.c | |
parent | 93812aa7950342c809a9dcbd9d50379c050b51ac (diff) | |
download | xscope-edca92c10572b6bb7dd60db156f545d98373f803.tar.gz |
Stop wrapping malloc & free
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Diffstat (limited to 'extensions.c')
-rw-r--r-- | extensions.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/extensions.c b/extensions.c index b120b3e..cf5421f 100644 --- a/extensions.c +++ b/extensions.c @@ -87,7 +87,9 @@ DefineExtNameValue(int type, unsigned char value, const char *extname) panic("Impossible argument to DefineExtNameValue"); } namelen += strlen(typename); - exttypename = Malloc(namelen); + exttypename = malloc(namelen); + if (exttypename == NULL) + panic("Can't allocate memory for ExtNameValue"); snprintf(exttypename, namelen, "%s%s", extname, typename); DefineEValue(&TD[type], (unsigned long) value, exttypename); } @@ -96,22 +98,26 @@ void ProcessQueryExtensionRequest(long seq, const unsigned char *buf) { int namelen = IShort(&buf[4]); - char *extname = Malloc(namelen + 1); + char *extname = malloc(namelen + 1); struct extension_info *qe; + if (extname == NULL) + panic("Can't allocate memory for ExtensionRequest name"); memcpy(extname, &buf[8], namelen); extname[namelen] = '\0'; for (qe = query_list; qe != NULL; qe = qe->next) { if (strcmp(extname, qe->name) == 0) { /* already in list, no need to add */ - Free(extname); + free(extname); return; } } /* add to list */ - qe = Malloc(sizeof(struct extension_info)); + qe = malloc(sizeof(struct extension_info)); + if (qe == NULL) + panic("Can't allocate memory for extension_info"); qe->name = extname; qe->request = 0; qe->event = 0; |