Author: jmb
Date: Sun Jan 28 23:53:20 2007
New Revision: 3153
URL:
http://svn.semichrome.net?rev=3153&view=rev
Log:
Handle strdup failure
Modified:
trunk/netsurf/content/urldb.c
Modified: trunk/netsurf/content/urldb.c
URL:
http://svn.semichrome.net/trunk/netsurf/content/urldb.c?rev=3153&r1=3...
==============================================================================
--- trunk/netsurf/content/urldb.c (original)
+++ trunk/netsurf/content/urldb.c Sun Jan 28 23:53:20 2007
@@ -2587,6 +2587,9 @@
/* strip fragment */
urlt = strdup(url);
+ if (!urlt)
+ return false;
+
scheme = strchr(urlt, '#');
if (scheme)
*scheme = '\0';
@@ -2762,7 +2765,8 @@
* \param cookie Pointer to cookie string (updated on exit)
* \return Pointer to cookie structure (on heap, caller frees) or NULL
*/
-struct cookie_internal_data *urldb_parse_cookie(const char *url, const char **cookie)
+struct cookie_internal_data *urldb_parse_cookie(const char *url,
+ const char **cookie)
{
struct cookie_internal_data *c;
const char *cur;
@@ -3267,7 +3271,8 @@
assert(p <= end);
/* Now create cookie */
- struct cookie_internal_data *c = malloc(sizeof(struct cookie_internal_data));
+ struct cookie_internal_data *c =
+ malloc(sizeof(struct cookie_internal_data));
if (!c)
break;