diff options
author | Ross Burton <ross@linux.intel.com> | 2010-08-06 13:11:10 +0100 |
---|---|---|
committer | Ross Burton <ross@linux.intel.com> | 2010-08-06 18:09:10 +0100 |
commit | 01dc568ed85c3e7eba9dbf570020f57e962099c2 (patch) | |
tree | b86da08fe04c4f4f2cea5c3ef917eea81fcbb41d | |
parent | 4270d6a1be09baecc975f06b9d884aaa9019a2f8 (diff) | |
download | librest-01dc568ed85c3e7eba9dbf570020f57e962099c2.tar.gz |
rest-param: if we're passed NULL in _new_string, replace it with empty string
-rw-r--r-- | rest/rest-param.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/rest/rest-param.c b/rest/rest-param.c index 2709c88..9ed3237 100644 --- a/rest/rest-param.c +++ b/rest/rest-param.c @@ -182,6 +182,12 @@ rest_param_new_string (const char *name, RestMemoryUse use, const char *string) { + + if (string == NULL) { + use = REST_MEMORY_STATIC; + string = ""; + } + return rest_param_new_full (name, use, string, strlen (string) + 1, g_intern_static_string ("text/plain"), |