]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - common/env_attr.c
dfu: add common function to initiate transaction
[people/ms/u-boot.git] / common / env_attr.c
index 386219087b8cff46d0e321bdda456d8ee5ef0924..f965b4bbb6a917fb5f27642bc88b66f73ac2da96 100644 (file)
@@ -132,6 +132,10 @@ static int regex_callback(const char *name, const char *attributes, void *priv)
                if (slre_match(&slre, cbp->searched_for,
                               strlen(cbp->searched_for), caps)) {
                        free(cbp->regex);
+                       if (!attributes) {
+                               retval = -EINVAL;
+                               goto done;
+                       }
                        cbp->regex = malloc(strlen(regex) + 1);
                        if (cbp->regex) {
                                strcpy(cbp->regex, regex);