diff options
author | Thomas White <taw@bitwiz.org.uk> | 2013-08-17 22:22:17 +0200 |
---|---|---|
committer | Thomas White <taw@bitwiz.org.uk> | 2013-08-17 22:22:17 +0200 |
commit | 4a164b5f3020b75c55a26ea20f8ed6fcabfaa66d (patch) | |
tree | 4401b08633f1a7009c58c200dd04ab7e335f9b26 | |
parent | 8d341bdb00df96e549f0cadc64c25cfa4f09294a (diff) |
Avoid strdup(NULL)
-rw-r--r-- | src/frame.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/frame.c b/src/frame.c index 3e207cd..bc0f744 100644 --- a/src/frame.c +++ b/src/frame.c @@ -189,7 +189,11 @@ static void parse_options(struct frame *fr, const char *opth, StyleSheet *ss) int i; size_t len; size_t start; - char *opt = strdup(opth); + char *opt; + + if ( opth == NULL ) return; + + opt = strdup(opth); len = strlen(opt); start = 0; |