Fix a bug caused by using sizeof(pointer) instead of sizeof(the struct)
authorRussell Bryant <russell@russellbryant.com>
Wed, 12 Nov 2008 19:38:51 +0000 (19:38 +0000)
committerRussell Bryant <russell@russellbryant.com>
Wed, 12 Nov 2008 19:38:51 +0000 (19:38 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@156298 65c4cc65-6c06-0410-ace0-fbb531ad65f3

res/res_clialiases.c

index bc2942b..1da4ea4 100644 (file)
@@ -212,7 +212,7 @@ static void load_config(int reload)
                        if (!(alias = ao2_alloc((sizeof(*alias) + strlen(v1->name) + strlen(v1->value) + 2), alias_destroy))) {
                                continue;
                        }
-                       alias->alias = ((char *) alias) + sizeof(alias);
+                       alias->alias = ((char *) alias) + sizeof(*alias);
                        alias->real_cmd = ((char *) alias) + strlen(v1->name) + 1;
                        strcpy(alias->alias, v1->name);
                        strcpy(alias->real_cmd, v1->value);